bannerview.destroy or bannerview.hide does not work

1,244 views
Skip to first unread message

iamer...@gmail.com

unread,
Apr 8, 2016, 12:36:59 AM4/8/16
to Google Mobile Ads SDK Developers
Hi!

I manage to get bannerview.show() working in my iOS device (I am building with Unity). However trying to destroy/hide it does not work. It works once but subsequent times (using the same code) no longer works.
I put in debug logs and I know the destroy and hide functions are being called BUT the ad is still showing and eventually it will cause my FPS to drop alarmingly.

Why is this happening? Is there a bug?

thanks!

iamer...@gmail.com

unread,
Apr 8, 2016, 12:40:12 AM4/8/16
to Google Mobile Ads SDK Developers
just some more info, 
XCODE Version 7.3
UNITY Version 5.3.4f1
SDK Version 7.7.0
googleads-mobile-unity-master Version 3.0.3

iamer...@gmail.com

unread,
Apr 8, 2016, 12:49:40 AM4/8/16
to Google Mobile Ads SDK Developers
also Iphone6, OS = 9.3.1


On Friday, April 8, 2016 at 12:36:59 AM UTC-4, iamer...@gmail.com wrote:

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 8, 2016, 10:46:02 AM4/8/16
to Google Mobile Ads SDK Developers
Hi there,

When you call destroy() on the BannerView, it would effectively remove any reference to the instance of the AdView. You would have to make a new AdRequest to show the BannerView again. Do send us your implementation code for us to debug further. You can also look at our sample app to checkout the proper implementation for this.

Thanks,
Veer Busani
Mobile Ads SDK Team

iamer...@gmail.com

unread,
Apr 8, 2016, 10:58:09 AM4/8/16
to Google Mobile Ads SDK Developers
Hey Veer,

So I did use the sample app's googlemobileadsdemoscript and what I did was directly call RequestBanner() whenever I want to show the banner and then have a new function that calls bannerView.destroy(), which is same as in the script. Will that already work?

also i know that the bannerview reference is not null when I attempt to destroy it and it does run the code (my debug log shows it is running) but the ad still shows on screen. attached is the script

thanks!
GoogleMobileAdsDemoScript.cs

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 8, 2016, 11:37:37 AM4/8/16
to Google Mobile Ads SDK Developers
Hi there,

So just to confirm, you were able to destroy() the BannerView when you used the demo script? If that is case, I might assume that you are not holding onto your BannerView's reference properly. Do send us a snippet of your implementation and we would look into this.

Thanks,
Veer Busani
Mobile Ads SDK Team

iamer...@gmail.com

unread,
Apr 8, 2016, 12:04:06 PM4/8/16
to Google Mobile Ads SDK Developers
Hey Veer,

so I was able to destroy it the FIRST time.. after that it doesn't seem to destroy even though my code says it did. Doesn't seem to destroy because I can still see the ad on my screen.

my implementation is just to call the script i attached and call RequestBanner() and DestroyBanner()

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 8, 2016, 2:53:49 PM4/8/16
to Google Mobile Ads SDK Developers
Hi there,

I was able to test on Xcode 7.3, iPhone 6S 9.3.1, Unity 5.3.4f1 with Mobile Ads Unity Plugin 3.0.3 and was not able to reproduce the issue. The script that you have attached does not show from where you are trying to request and show Banner Ads. Do send us a sample app, which would replicate the issue and we would look into this.

Thanks,
Veer Busani
Mobile Ads SDK Team

iamer...@gmail.com

unread,
Apr 8, 2016, 3:02:52 PM4/8/16
to Google Mobile Ads SDK Developers
Hey Veer,

so all I did was another script that called the googleads script and had this functions:

googleAdsObject.GetComponent<GoogleMobileAdsDemoScript> ().RequestBanner ();
googleAdsObject.GetComponent<GoogleMobileAdsDemoScript> ().DestroyBanner(); 

I will try again.. it just seems strange behavior that the first call of DestroyBanner actually kills the banner but after request again it does not destroy. Just wondering if I accidentally call Requestbanner too many times, will it layer one banner over another (thus multiple banners on the same spot)?

that may explain why...

does every RequestBanner create a new instance of BannerView? 

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Apr 8, 2016, 3:15:28 PM4/8/16
to Google Mobile Ads SDK Developers
Hi there,

BannerView is not a Singleton and it would certainly create as many instances as you want. So do check your logic here when you are trying to request ads and see if this fixes the issue.

Thanks,
Veer Busani
Mobile Ads SDK Team

iamer...@gmail.com

unread,
Apr 8, 2016, 6:30:10 PM4/8/16
to Google Mobile Ads SDK Developers
ok i figured out what went wrong.
when i restart my scene, i think it auto creates another banner or another instance of googleads script.. or something similar.
in anycase, now that i modified my game to reload values instead of reload the entire scene, the admob works as expected..

Cod Razzi

unread,
Mar 22, 2019, 3:06:16 AM3/22/19
to Google Mobile Ads SDK Developers
hi...i am using banner view the issue is when i request for banner view...sometime it shows late because of internet speed...i destroy the banner view on scene load but but banner still shows on other scene....because the banner request full fills late........

mobileadssdk...@google.com

unread,
Mar 22, 2019, 3:34:16 PM3/22/19
to Cod Razzi, Google Mobile Ads SDK Developers
Hello there,

Thanks for reaching out to us. Are you using destroy() when you do not want to have a reference to the BannerView? This is an implementation issue and you seem to be showing the BannerView on the root Scene on your app and it's showing on all of the screens. The best approach would be to clean up the BannerView by calling destroy().

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/e178e6a3-ece5-4c9f-8008-19d2b61fea0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages