Preload ads on your users’ devices to boost their experience! Ads will load faster when requested, and you can verify that an ad is available before displaying it.
Table of Contents ▼
Caching ads
Use the following methods to cache ads so they can be displayed later. We use
CBLocationHomeScreen
as our example named location.
Checking for cached ads
PRO TIP: Use these methods to check if an ad has been preloaded before you try to show it. If an ad isn’t already cached, you should probably cache one!
Optional: You also can receive notification from the SDK when an ad is successfully cached by implementing these delegate methods.
If the cache calls fails, a
didFailToLoadInterstitial
delegate method will fire. This delegate also fires if you call showInterstitial
and an ad fails to display. Do NOT make cache or show calls inside didFailToLoad
delegates or the universe will implode.Autocaching
PRO TIP: Chartboost SDKs automatically cache ads after they’ve been successfully displayed at a named location. However, it’s best practice to also manually cache ads at bootup or other relevant points in your app before you need to display them.
Autocaching will not cause unnecessary network requests. Any cache calls will only send network requests if the cache is empty at a specific location.
Use the following SDK methods to toggle autocaching.
Some more things to know about caching
[Chartboost showInterstitial:CBLocationHomeScreen];
displays a cached interstitial if one exists. Otherwise, it will request one from the server.- We recommend caching for optimal performance and user experience; however, it’s always a good idea to be conscious of your users’ data usage.
- Cached interstitials automatically expire after 24 hours.
- Cache requests are asynchronous. Keep this in mind if you cache many interstitials while loading other data for your app.
You might also like…
- Named locations: Show different ad campaigns at different points in your game and fine-tune your campaigns’ behavior from your dashboard.
Last Updated on August 22, 2022