public void OnInterstitialWithEngageBtn_Clicked()
{
var engagement = new Engagement("showInterstitial");
DDNA.Instance.RequestEngagement(engagement, response => {
var interstitialAd = InterstitialAd.Create(response);
if (interstitialAd != null) // Engagement didn't prevent ad from showing
{
interstitialAd.OnInterstitialAdOpened += () => {
Debug.Log("Interstitial Ad opened its ad.");
};
interstitialAd.OnInterstitialAdFailedToOpen += (reason) => {
Debug.Log("Interstitial Ad failed to open its ad: " + reason);
};
interstitialAd.OnInterstitialAdClosed += () => {
Debug.Log("Interstitial Ad closed its ad.");
};
interstitialAd.Show();
}
else
{
Debug.Log("Engage disabled the interstitial ad from showing.");
}
}, exception => {
Debug.Log("Engage encountered an error: " + exception.Message);
});
}