Is it possible to check whether the banner is open now? It is necessary to hide the banner when we go into the settings, and open when we exit the settings, but when there is no banner, we don’t boot up or load, and we go into the settings, then there is no link .. how can this be circumvented?
2 answers
Well, it is logical to assume that before trying to do anything with a banner, you need to check if it is not null. Are you using a plugin for Unity ? Through its methods, check whether banner is loaded now.
It is more difficult to say, because You have not attached a code, during the execution of which an error occurs (the string in which it occurred is written in the error text).
|
Clarification of the above advice. Through the plugin's methods for Unity , a check is available whether the banner is loaded now .:
Use the OnAdLoaded and OnAdFailedToLoad events of the GoogleMobileAds.Api.BannerView class:
... this.bannerView.OnAdLoaded += this.HandleAdLoaded; this.bannerView.OnAdFailedToLoad += this.HandleAdFailedToLoad; ... public void HandleAdLoaded(object sender, EventArgs args) { Debug.Log("HandleAdLoaded event received"); } public void HandleAdFailedToLoad(object sender, AdFailedToLoadEventArgs args) { Debug.Log("HandleFailedToReceiveAd event received with message: " + args.Message); } |