AdMob ad caching


I’m currently a little bit confused with the sdkbox admob plugin.
I’m caching ads once on start up and afterwards only use show() to display ads.
This seems to work, but in somecases I’m not getting ads.

Is this the correct way to do it, or should I use cache everytime before I try to use show()?
I’m a little confused about the usage because in the sdkbox guide it says the following:

cache ad:
NOTE : AdMob ads needs to be cached before use, auto-caching is not available with this plugin. It might take couple of minutes to cache ads, once cached you would be able to see the ads. While caching, ads are not available.

(maybe this is outdated, since some threads had similar questions)

But it also says:

Auto cache

The plugin will auto cache the first Ad of one Ad type. It also will cache the interstitial/Reward Ad after it close.

For the latter this means it sometimes does cache and sometimes doesn’t?
Also do I need to call cache() again when an ad fails to load through adViewDidFailToReceiveAdWithError?

In some cases ads didn’t work, probably when an error occurs when calling cache() on startup, in those cases show() won’t do anything until I restart the app.

For those cases it worked when calling cache() everytime adViewDidFailToReceiveAdWithError is called, but this seems not to be a good idea, because It would failed a few times an call cache everytime again, but at least ads would show again at some point.

If anyone has more info, pls let me know

PluginAdMob have two api for cache:

>>> set auto cache ad after @seconds when cache ad failed.
>>> @seconds <= 0 means do not cache by PluginAdMob when cache ad failed.
* setAutoCacheDelay(int second)

>>> auto load ad when `plugin init` or `ad close`
* setAutoCache(bool cache)

Thanks, I’ll use those :slight_smile:

Also I might have found the cause for ads not being displayed on some of the devices.!topic/google-admob-ads-sdk/afz2aCSXSkU
“The reason why only some devices get ads is primarily because of the various screen sizes. There might not be enough creatives available to span all of the screen sizes available on the market. For devices for which a creative cannot fit, the server will issue a no-fill error. Therefore the ad will not display”

Maybe it is still an implementation issue from my side tho (need to find workaround), since other games which use admob(i think) are able to display interstitial ads.