- Home /
Android Banner disappears after touching the screen
So I made a dice app with unity and I am trying to display a banner at the bottom. It used to work fine until an update that had nothing to do with the ad and then the ad started disapearing when I touch the screen, here's a 10 second video of the disappearing ad: https://www.youtube.com/watch?v=fICWqi22Rf8&feature=youtu.be
And here's the code for the advertisment
private BannerView bannerView;
void Start()
{
string appId = "...";
MobileAds.Initialize(appId);
RequestBanner();
}
private void RequestBanner()
{
#if UNITY_ANDROID
string adUnitId = "...";
#elif UNITY_IPHONE
string adUnitId = "...";
#else
string adUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
bannerView.OnAdLoaded += HandleOnAdLoaded;
bannerView.LoadAd(request);
}
public void HandleOnAdLoaded(object sender, EventArgs args)
{
bannerView.Show();
}
Answer by wouter_vandenputte · Jan 05, 2018 at 01:49 PM
If anyone else has it, I fixed it by deleting the Plugins folder, the PlayService folder and the GoogleMobileAds folder, I then redownloaded the package and imported it again.
Answer by florinel2102 · Dec 05, 2020 at 03:50 PM
Hello, I had the same error with Appodeal SDK, but after I added the following line of codes in the ad manager it worked
void OnApplicationFocus(bool hasFocus)
{
if(hasFocus)
{
Appodeal.onResume(Appodeal.BANNER_TOP);
}
}
Your answer
Follow this Question
Related Questions
Admob works on an empty project but not on my actual project 0 Answers
Unity Admob Banner is not clickable. 0 Answers
Implementing AdMob into Android Mobile Games 1 Answer
AdMob Custom Banner Size 1 Answer
Admob calculating banner Ad size 0 Answers