Greetings. I have a pretty odd problem, which after 2 days of searching the whole Internet and also searching this forum, is still bothering me. I thought that maybe here, someone is able to aid me or tell me what I did wrong.
I have imported the GoogleMobileAds.unitypackage (2.1) from
https://github.com/googleads/googleads-mobile-plugins/releases/tag/v2.1 and Unity accepted it without problem, creating the "GoogleMobileAds" and "Plugins" folders in my "Assets" folder. After taking a good look in the ReadMe file, I wrote a simple code which looks like this :
InterstitialAd reclama = new InterstitialAd("...");
AdRequest req = new AdRequest.Builder().Build();
reclama.LoadAd(req);
if (reclama.IsLoaded())
reclama.Show();
Each line is immediately one after another, declaring the interstitial and the request in the same function. I later declared them globally, but it made the app crash on an actual device, while in the Unity editor it had no effect.
The interstitial is registered at the AdMob site and the ad unit is placed correctly, although I don't think this was necessary.
I also copied the "google-play-services_lib" folder from the Android SDK installation location into the "Plugins\Android\" folder. The AndroidManifest from the package already came with the INTERNET and ACCESS_NETWORK_STATE permission tags written, but this lib folder brought another AndroidManifest (no file conflict, the original manifest and the folder are in the same directory tree level and the new manifest inside this folder) and I got pretty confused as to which manifest I should use. I couldn't seem to find anything related to the publisher ID though, in both manifests.
All the action takes place in the "Assets" Unity folder - the scene, resources, etc. When I start the game both in the editor and my device, no ad shows up, even though when, launching in the editor, the console looks like this :
• Created DummyClient
UnityEngine.Debug:Log(Object)
• Dummy CreateIntersitialAd
UnityEngine.Debug:Log(Object)
• Dummy LoadAd
UnityEngine.Debug:Log(Object)
• Dummy IsLoaded
UnityEngine.Debug:Log(Object)
• Dummy ShowInterstitial
UnityEngine.Debug:Log(Object)
I suppose that I made this right, but as the ads are not showing even when adding ".AddTestDevice()." in the ad request function, I just want to make sure it is done the right way. Do you have any suggestions I might make use of ?