I had Admob working, then I installed the Google Play plugin and then I could not get Admob working again. All compiles and builds onto the Android device, but no ads are shown. Trying to resolve the issue, I did following:
public class AdManager : MonoBehaviour {
private BannerView bannerView;
// Use this for initialization
void Start ()
{
#if UNITY_ANDROID
string appId = " my appId here ";
#else
string appId = "unexpected_platform";
#endif
// Initialize the Google Mobile Ads SDK.
MobileAds.Initialize(appId);
this.RequestBanner();
}
private void RequestBanner()
{
#if UNITY_ANDROID
string sampleAdUnitId = "ca-app-pub-3940256099942544/6300978111";
#else
string sampleAdUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
bannerView = new BannerView(sampleAdUnitId, AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
bannerView.LoadAd(request);
}
}
Attached is a dump of the Logcat taken with Android Studio from my Samsung phone, Verbose, sorted on keyword "Ads". This is my first time Logcat, so if something is missing, let me know.
Why are my ads not shown? Thanks, JanHello Bharani,
Thanks. The problem on my mobile phone persists on Wifi and Umts. However on my Samsung Note tablet the ads work fine. So it is definitely something with my phone. I will need to figure out what it is, but at least I can continue my development using Admob. Thanks for your help.
Regards, Jan