- Home /
How to hide AdMob ads?
Greetings,
I'm trying to include ads in a newly created mobile game (just for Android at the moment) and I ran into some trouble regarding when the ads should be disabled.
I have used the tutorial found here to include ads via Admob into my game and everything is working perfectly fine, the ads show up at the right time on my mobile phone. The problem is that I want to disable the ads when I change my scene. There are two ways I found I could do that, but neither of them did exactly the right thing:
1) If I use the bannerView.hide(); method, the banner flicks, as if it went away for a milisecond and then returns and permanently stays in its position.
2) If I use the bannerView.destroy(); method, the banner disappears, but it also doesn't load in the same scene afterwards so it can only be used once.
I have been searching for quite a while to find a solution, but failed to find any that worked. Would really appreaciate if anybody had ideas as to how to approach the problem.
Thanks!
Answer by Vitor_r · Oct 03, 2014 at 01:25 PM
Where are you calling the bannerView.Hide()? What method? When?
To hide the Ad this method should work, unless you call the bannerView.Show() somewhere else in the code after hiding the Ad.
Thank you for your comment, it helped me deduce where the problem has occured. The thing is, I called the bannerview.show methods from the OnGUI method which caused it to be called multiple times and a single call of the bannerview.hide method didn't actually do anything.
Sorry for the delay with my answer, I had some errors in my code which I had to spend a week correcting before I could check this solution out :)