Monetize

Last Updated on

July 15, 2022

Android (delegate methods)

Overview

The Chartboost SDK's delegate methods allow you to exercise a greater degree of control over your integration. For example, you can:

  • Log debug messages when your game attempts to load an interstitial.
  • Prevent ads from showing the first time a user plays your game.
  • Determine whether a user has clicked an ad or just closed it  and react accordingly.
  • Prevent an interstitial page appearing when and where it would interfere with your game.

You can view the Chartboost Android SDK methods at your disposal in the documentation located in the doc folder included with your Android SDK download. You can see many of these methods in use in the sample project included in the package. SDK configuration methods

Click here to view Android configuration methods. 

SDK delegate setup

Before using any delegate functions, set the Chartboost delegate in your activity's onCreate() method, like so:

After that, initiate the delegate object and declare the delegate methods as follows:

Ad Identifier

CBImpressionError objects passed as parameters in delegate method calls include an adID property.

This is a string that uniquely identifies a cached ad. It might help when working with Chartboost to identify faulty creatives.

Static & video interstitial delegate methods

Don’t make cache or show calls inside didFailToLoad delegates or the universe will implode.

Rewarded video delegate methods

Don’t make cache or show calls inside didFailToLoad delegates or the universe will implode.

Misc. delegate methods

Don’t make cache or show calls inside didFailToLoad delegates or the universe will implode.

Age gate delegate methods

Age gate methods for Android have been deprecated.

 

GDPR
Override your activity's lifecycle methods