asales Expert Licensed User Longtime User Jul 25, 2021 #1 I want to show the AppOpenAd everytime that user open the app. I create an splashscreen class to wait to load the ad and show it. I call the splash class in B4XPage_Foreground: B4X: Copy Sub B4XPage_Foreground Ads.Initialize CheckConsentAndAddAds Root.LoadLayout("splash") Splash.Initialize Splash.Show(pContent) End Sub After the splash finish, the class call the sub: B4X: Copy CallSub(B4XPages.MainPage,"MainScreen") To show the main screen and start the AppOpenAd B4X: Copy Sub MainScreen Root.LoadLayout("MainPage") (...) Ads.ShowOpenAdIfAvailable End Sub When the AppOpenAd is show, it call the sub B4XPage_Background and when it closed it call the B4XPage_Foreground with the splash, in a infinity loop. How can I solved it: how the splash and ad everytime that the user open the app and when the ad is closed, it show the main screen? Thanks in advance for any tip.
I want to show the AppOpenAd everytime that user open the app. I create an splashscreen class to wait to load the ad and show it. I call the splash class in B4XPage_Foreground: B4X: Copy Sub B4XPage_Foreground Ads.Initialize CheckConsentAndAddAds Root.LoadLayout("splash") Splash.Initialize Splash.Show(pContent) End Sub After the splash finish, the class call the sub: B4X: Copy CallSub(B4XPages.MainPage,"MainScreen") To show the main screen and start the AppOpenAd B4X: Copy Sub MainScreen Root.LoadLayout("MainPage") (...) Ads.ShowOpenAdIfAvailable End Sub When the AppOpenAd is show, it call the sub B4XPage_Background and when it closed it call the B4XPage_Foreground with the splash, in a infinity loop. How can I solved it: how the splash and ad everytime that the user open the app and when the ad is closed, it show the main screen? Thanks in advance for any tip.
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2021 #2 Start with the example: https://www.b4x.com/android/forum/t...dmob2-google-mobile-ads-v20-0.129696/#content Upvote 0
Start with the example: https://www.b4x.com/android/forum/t...dmob2-google-mobile-ads-v20-0.129696/#content