Android Question Admob Ad implementation

Dennis Glowack

Member
Licensed User
I'm trying to add ads to my Android version of my app. I've read everything I could find; but now, I'm stuck. So far, this is what I have done:

1) Added Android version of my app to Admob
2) Updated Manifest with the following:

1596136257331.png


2) Added FirebaseAdmob library in IDE (none of the services were added, at this point. Admob not linked to Firebase)
3) Added to Service_Create Sub in Starter Module:

Dim MobileAds As MobileAds
MobileAds.Initialize


4) Updated SDK with all Recommended items.
5) Added Erel's CheckForGooglePlayServices Sub to Starter Module
6) Implemented code to show ad:

Dim iad As InterstitialAd
iad.Initialize("iad","ca-app-pub-3940256099942544/1033173712") 'Google test Interstitial ad
iad.load

Observations:
Programs compiles without errors
iad.Ready always returns false
iad_ReceiveAd never fires
And a really strange thing happened twice: I saw the sample ad appear on the device when it wasn't called. I don't know how or what caused it. I can't duplicate it, either. That incident gave me hope that I was on the right track, but alas, I'm stuck.

As always, thanks in advance for any help.
 
Now I'm seeing the test ad. However, not when I want. I added the code to show the ad in the Activity_Create Sub of the module. No ad shows. If I place the call to show it in the Activity_Resume Sub, it doesn't show, either. However, if I send the app to background, the ad shows when the app returns to the foreground (Activity_Resume).

So, am I calling the ad to show in the wrong place?
 
Upvote 0
Check this example and compare with your code:
 
Upvote 0
Check this example and compare with your code:

Thanks. Your work here has been helpful, especially with the banner ads.
 
Upvote 0
Back
Top