AdMob isLoaded causes app to hang

Hi guys,

My app loads the Admob like below, and when home-button is clicked <1second after the app is loaded, the ‘applicationSuspend’ state is not received . This causes the app to hang, and upon reloading it, it will just show a blank screen until Android OS ask to close the app (will take around 1 minute). After that it  can load again, but the problem persists if user clicks the home-button fast.

  1. app starts and calls a composer scene
  2. in scene:show(did), ‘admob.init’ is called
  3. When admob listener receives '_event.phase == “init” ’ , _will check for admob.isLoaded( ‘banner’ ), and if it is false, will call admob.load( ‘banner’)

Problem is the check for admob.isLoaded() before calling admob.load()

If I remove the admob.isLoaded(), the problem does not seem to show and ‘_applicationSuspend’ _is received.

I think the docs should add this clause in it.

I’ll see if I can replicate your issue, however please note that init() for any of our monetization plugins should be called once and only once during an app session. It’s therefore recommended to put init() in main.lua

Thanks.

I put the admob features in another .lua file, which ensures all the admob functions are centralised. The init() is also called only once. Don’t remember seeing this issue in the old free admob 2016 plugin. I guess a lot has changed in the new paid admob.

I’ll see if I can replicate your issue, however please note that init() for any of our monetization plugins should be called once and only once during an app session. It’s therefore recommended to put init() in main.lua

Thanks.

I put the admob features in another .lua file, which ensures all the admob functions are centralised. The init() is also called only once. Don’t remember seeing this issue in the old free admob 2016 plugin. I guess a lot has changed in the new paid admob.