【问题标题】:Destroy Banner/Interstitial ads of AdMob?销毁 AdMob 的横幅/插页式广告?
【发布时间】:2015-02-23 11:26:01
【问题描述】:

我有一个只需要在主菜单中显示的横幅。我想在玩家完成游戏并返回主菜单时显示插页式广告。请求和显示广告没有问题。但是,谷歌告诉我

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.

我不知道什么时候应该销毁我的广告?每次玩家退出游戏(对于横幅)?每次玩家从主菜单进入游戏(对于横幅)?我是否应该在展示后销毁插页式广告,并在我想再次展示时请求返回?

【问题讨论】:

    标签: unity3d admob unityscript


    【解决方案1】:

    您应该在丢失对广告变量的引用之前调用destroy()。因此,如果您的广告在 ActivityB 上并且您退出到 ActivityA,那么您应该在 ActivityB 的 onDestroy() 方法中调用 ad.destroy()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-28
      • 1970-01-01
      相关资源
      最近更新 更多