Android Question Firebase Admob interstitial ad issue

Hey everyone, I have been trying to implement interstitial ads in my app. The app is composed of several buttons which lead to different menus, and when the user enters one of the menus, an intestitial ad will be loaded so that the user has to watch an ad before accessing the content.

Basically, I want to load an interstitial ad between the moment the user has left the main activity and before the loading of the menu's activity. I successfully implemented Firebase Admob services, I have been testing it with banner ads and it works just fine, but I haven't figured out how to use the intestitial ad in the way I need it to.

Thanks for anyone who's willing to help me out, and I hope this post will help others as well.
 

asales

Expert
Licensed User
Longtime User
Put the code to open the new activity when the interstitial was closed:
B4X:
Sub mwadi_AdClosed
    Log("mwadi AdClosed")
    mwAdInterstitial.LoadAd 'prepare a new ad

    StartActivity(NewMenu)
End Sub

Check the new example with B4XPages that has a code snippet to this (using B4XPages):
 
Upvote 0
Thanks for the reply @asales, I tested the code and thanks to you, I finally made it work ! I can finally publish my app now, I'm so excited! Thanks for the assistance, I would have probably lost several more hours trying to figure it out myself.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
What you're trying to do is against the guidelines of admob and you'll risk to lose ad feed to your app.

check


" Ads should not be placed in a way that prevents viewing the app’s core content. Ads should not be placed in a way that interferes with navigating or interacting with the app’s core content and functionality. "

and it shows that you shouldn't use it between menu click and the resulting page.
 
Upvote 0
Top