[WP8] Tip: Interstitials sometimes don't get displayed?

Skip to first unread message

arnie runzl

Oct 10, 2014, 6:09:18 AM10/10/14
to google-adm...@googlegroups.com
Just resolved the following issue and would like to share it :)

About 30% of our interstitials didn't get displayed on our WindowsPhone.
You sometimes read the console message "Loaded ad with sourcecode: + html code" but the code was then never loaded into the weview, meaning e.g. this log "Ad loaded into webview" never appeared.

The reason seems to be in the Admob_OnAdReceived(object sender, AdEventArgs e) callback, where we then call admobInterstitialAd.ShowAd(); automatically, as soon as the ad is loaded.

The wrong way is to cast
InterstitialAd admobInterstitialAd= (InterstitialAd)sender;
in Admob_OnAdReceived.

The right way is to create a member variable and assign it when you create the ad:
admobInterstitialAd = new InterstitialAd(this.admobAdUnitId);

Maybe that helps some people running in the same, wrong way.
Reply all
Reply to author
0 new messages