Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy Banner/Interstitial ads of AdMob? #72

Closed
simsis3d opened this issue Feb 23, 2015 · 1 comment
Closed

Destroy Banner/Interstitial ads of AdMob? #72

simsis3d opened this issue Feb 23, 2015 · 1 comment

Comments

@simsis3d
Copy link

I have a banner which only needs to be shown in main menu. And I want to show interstitials whenever player finish the game and about to return back to mainmenu. There is no problem for requesting and showing ads. However, google says me that

"When you are finished with a BannerView or InterstitialAd, make sure to call the Destroy() method before dropping your reference to it.

bannerView.Destroy();
interstitial.Destroy();

This notifies the plugin that the object should be garbage collected. Failure to call this method will result in memory leaks."

I dont know when I should destroy my ads? Eachtime player exit game (For banner)? Eachtime player goes from mainmenu to game (For banner)? Should I destroy interstitials after showing it and request back when I want to show again?

@rampara
Copy link
Contributor

rampara commented Feb 23, 2015

You should call the Destroy() method on bannerViews and interstitials when you are no longer going to use them or are going to lose reference to them. You can use a single bannerView show multiple ads without calling Destroy() if you maintain a reference to them. Interstitials are one time use objects and should be destroyed after displaying an ad.

@rampara rampara closed this as completed Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants