Hello people,
I’ve been dealing with the google admob plugin on android device. Problem is sometimes banner doesn’t show up and when that happens if i call Application.Quit(); game freezes and i have to force stop the game (phone restarts if i try to uninstall the app w/o force stoping it ). So i know theres some thing wrong with my scripting. Just can’t figure out what. Heres the last state of the code and what i tried:
public void GetBanner()
{
try
{
bannerView = new BannerView ("admob ID ", AdSize.SmartBanner, AdPosition.Bottom);
AdRequest getAd = new AdRequest.Builder().Build();
bannerView.LoadAd(getAd);
}
catch ( Exception error )
{
Debug.Log( error );
}
}
public void ShowBanner()
{
try
{
bannerView.Show();
}
catch( Exception error )
{
Debug.Log (error);
}
}
public void DestroyBanner()
{
try
{
bannerView.Destroy();
}
catch( Exception error )
{
Debug.Log(error);
}
}
I call the RequestBanner() in the start function and call ShowBanner(); in the update function
and i destory the banner before quiting. i tried to put RequestBanner and ShowBanner to some of the GUI buttons i use in game ( like Play and Back ) but that way i couldnt even get it show the banner. So as far as i know theres no way to detect if banner is loaded. if theres one please tell or any other ideas, tips, i’ll much appreciate. thank you