I have noticed a behaviour i think is strange, and I would be interested in hearing other people’s takes and experiences regarding the ads-plugin(s) and internet connectivity.
Specifically, what happens when the app is started without internet connectivity and later gains connectivity, the ads never seem to load.
Consider this scenario, which I tested and played around with, using admob:
-
I launch my app in airplane mode, i.e. without internet connectivity: the ads.init()-command doesn’t seem to work nor trigger the adlistener at all, my print commands inside it are never triggered. Nor does the following commands like ads.show() and so on, which makes sense.
-
I then switch airplane mode back off while inside the app (or by suspending, turning airplane off, and resuming, same result) to enable to connectivity, and wait a while in the hopes of the adlistener being able to refresh, but nothing happens to make the ads load. This is whether or not I try to, via a timer, run the ads.init() command again (which gives the warning that they have already been initialized), do nothing, or just run ads.show() again - the ads are never shown when the internet connectivity is back.
-
The only way to get teh ads is to force quit the app and restart it; suspend and resume does nothing.
As a sidenote, I find it strange that the adlistener doesn’t get triggered from the init() command with an error flag, so we can track the fact that the ads we’re not launched, and keep retrying. However, even that, it seems to no avail if the availalbe ads commands do nothing anyway after an offline init.
It basically seems that you have one shot of initializing the ads, and if that fails, you’re doomed. I can imagine a scenario when someone for example starts the app on an airplane, and then continues to play it after they have landed, and then never gets the ads until they would force quit and hard reset the app. Obviously, this would be problematic.
Am I missing something here, or what is the best way to combat this - do I have to set up an independent network connection checker to see if it should even initialize the ads? How have you worked with offline ads initialization?