Interstitial ads display only once, unity sdk

2,049 views
Skip to first unread message

Orfeas Panagou

unread,
Jun 2, 2014, 4:12:43 AM6/2/14
to google-adm...@googlegroups.com
So, as my subject indicates, i have properly set up both a banner that works fine and an interstitial ad in my unity made app. The problem is that after the first interstitial, no more seem to appear when the conditions are met. Am i doing something wrong, do i need to make a new interstitial ad, do i need to rebuild or reload the one i already have, or should it just work with interestitial.show? I'm guessing its the last, since in the unity editor i get the debug log dummy interstitial show when the conditions are met. Any tips/help? Thanks. 
P.S. This has only been tested on android so far.

Orfeas Panagou

unread,
Jun 2, 2014, 8:10:14 AM6/2/14
to google-adm...@googlegroups.com
Ok apparently the interstitial object can only be used once, what is the proper way to create/load a new one?

Eric Leichtenschlag

unread,
Jun 2, 2014, 10:18:23 PM6/2/14
to google-adm...@googlegroups.com
You can simply create a new one and reassign to your same interstitial class member. Just make sure to call Destroy() on the old instance first, so it can get cleaned up properly:

interstitial.Destroy();
interstitial
= new InterstitialAd("your_ad_unit_id");
interstitial
.LoadAd(new AdRequest.Builder.Build());


Thanks,
Eric

Tony Chan

unread,
Aug 7, 2014, 9:24:19 PM8/7/14
to google-adm...@googlegroups.com
I store my InterstitialAd in a static field and reuse that variable to load a new one after showing the first one. Neither the new GPS API nor the old standalone AdMob one have a InterstitialAd.destroy() method though. How should we go about cleaning up the old InterstitialAd object before reassigning the variable to a new one?

Currently I just dereference my static field
sInterstitialAd = null;
when I think I won't need the ad anymore, hoping it will be garbage collected. Would be easier if there was an actual destroy() method though.

Eric Leichtenschlag

unread,
Aug 8, 2014, 12:37:57 PM8/8/14
to google-adm...@googlegroups.com
Hi Tony,

The original question was specifically about the unity plugin for the mobile ads SDK. The snippet I had above was actually a C# snippet, which is the common layer that Unity developers are familiar with.

If you're just developing on native Android, setting the interstitial object to null is sufficient for garbage collection.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages