- Home /
bannerView.Destroy(); is not working...the banner still appears after 2 sec
Hi. I have a issue with banner ads (i`m using GoogleMobileAds.api) The banner is automaticaly hidden by the script, then is destroyed also auto when the scene is changed but the banner ad still appear. If is present in game menu then is ok but appear in gameplay and that is bad. I don`t know who is starting the banner after i use button with destroy!!! Can someone help with this ? Here is my script (i added all kind of calls to destroy it and i can`t do that)
using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds.Api;
public class AdmobBanner : MonoBehaviour {
public string AppID;
public string BannerAdUnitID;
private BannerView bannerView;
public void HideBanner(){
{
bannerView.Hide();
}
}
public void DestroyBanner(){
{
bannerView.Destroy();
}
}
void OnDestroy(){
bannerView.Destroy();
}
void OnHide(){ bannerView.Hide(); }
public void DestroyBannerView(){ if (this.bannerView != null) { this.bannerView.Destroy(); } } void Start () {
MobileAds.Initialize(AppID);
bannerView = new BannerView(BannerAdUnitID, AdSize.Banner, AdPosition.Top);
bannerView.LoadAd(new AdRequest.Builder().Build());
}
}
Your answer
Follow this Question
Related Questions
How to hide AdMob ads? 1 Answer
Admob IOS, destroy the banner. [REAL NEED HELP] 4 Answers
AdMob banner causes frame rate lag, Android. 2 Answers
How to get banner ad's screenshot to a texture? 0 Answers
Regarding Admob Banner Ads position and game layout? 0 Answers