SDK Configuration Methods

Last Update:

 

These methods allow you to access Chartboost SDK functionality and settings. Choose a platform to view its methods.

 

iOS Android Unity
Adobe AIR iOS Swift Amazon



  // Checks for a cached interstitial at given CBlocation.
  + (BOOL)hasInterstitial:(CBLocation)location;

  // Checks for a cached moreApps page at given CBlocation.
  + (BOOL)hasMoreApps:(CBLocation)location;

  // Checks for a cached rewarded video at given CBlocation.
  + (BOOL)hasRewardedVideo:(CBLocation)location;

  // Check to see if any views are visible.
  + (BOOL)isAnyViewVisible;

  // Set to enable and disable the auto cache feature. Enabled by default.
  + (void)setAutoCacheAds:(BOOL)shouldCache;

  // Get the current auto cache behavior. Enabled by default.
  + (BOOL)getAutoCacheAds;

  // Set a custom identifier to send in the POST body for all Chartboost API server requests.
  + (void)setCustomId:(NSString *)customId;

  // Get the current custom identifier being sent in the POST body for all Chartboost API server requests.
  + (NSString *)getCustomId;

  // Decide if the Chartboost SDK should show interstitials in the first session.
  + (void)setShouldRequestInterstitialsInFirstSession:(BOOL)shouldRequest;

  //  Decide if the Chartboost SDK should show a loading view while preparing to display the MoreApps UI.
  + (void)setShouldDisplayLoadingViewForMoreApps:(BOOL)shouldDisplay;

  // Control whether the SDK downloads video creatives ahead of time for better performance. Enabled by default. If disabled, will severely impact the SDK’s ability to serve video ads!
  + (void)setShouldPrefetchVideoContent:(BOOL)shouldPrefetch;

  // Set to control how the fullscreen ad units should interact with the status bar. CBStatusBarBehaviorIgnore by default.
  + (void)setStatusBarBehavior:(CBStatusBarBehavior)statusBarBehavior;
  

Learn more about caching ▶

▲ Back to top

 

  // Checks for a cached interstitial at given location.
  public static boolean hasInterstitial(String location)

  // Checks for a cached MoreApps page at given location.
  public static boolean hasMoreApps(String location)

  // Checks for a cached rewarded video at given location.
  public static boolean hasRewardedVideo(String location)

  // Check to see if any views are visible.
  public static boolean isAnyViewVisible()

  // Set to enable and disable the auto cache feature. Enabled by default.
  public static void setAutoCacheAds(boolean autoCacheAds)

  // Get the current auto cache behavior. True by default.
  public static boolean getAutoCacheAds()

  // Set a custom identifier to send in the POST body for all Chartboost API server requests.
  public static void setCustomId(String customID)

  // Get the current custom identifier being sent in the POST body for all Chartboost API server requests.
  public static String getCustomID()

  // Decide if the Chartboost SDK should show interstitials in the first session.
  public static void setShouldRequestInterstitialsInFirstSession(boolean shouldRequest)

  //  Decide if the Chartboost SDK should show a loading view while preparing to display the MoreApps UI.
  public static void setShouldDisplayLoadingViewForMoreApps(boolean shouldDisplay)

  // Decide if the Chartboost SDK will attempt to fetch videos from the Chartboost API servers.
  public static void setShouldPrefetchVideoContent(boolean shouldPrefetch)
  

Learn more about caching ▶

▲ Back to top

 

  // Checks for a cached interstitial at given CBlocation.
  public static bool hasInterstitial(CBLocation location)

  // Checks for a cached moreApps page at given CBlocation.
  public static bool hasMoreApps(CBLocation location)

  // Checks for a cached rewarded video at given CBlocation.
  public static bool hasRewardedVideo(CBLocation location)

  // Check to see if any views are visible.
  public static bool isAnyViewVisible()

  // Set to enable and disable the autocache feature. Enabled by default.
  public static void setAutoCacheAds(bool autoCacheAds)

  // Get the current autocache behavior. Enabled by default.
  public static bool getAutoCacheAds()

  // Set a custom identifier to send in the POST body for all Chartboost API server requests.
  public static void setCustomId(String customId)

  // Get the current custom identifier being sent in the POST body for all Chartboost API server requests.
  public static String getCustomId()

  // Decide if the Chartboost SDK should show interstitials in the first session.
  public static void setShouldRequestInterstitialsInFirstSession(bool shouldRequest)

  //  Decide if the Chartboost SDK should show a loading view while preparing to display the MoreApps UI.
  public static void setShouldDisplayLoadingViewForMoreApps(bool shouldDisplay)

  // Decide if the Chartboost SDK will attempt to fetch videos from the Chartboost API servers.
  public static void setShouldPrefetchVideoContent(bool shouldPrefetch)

  // Set to control how the fullscreen ad units should interact with the status bar. CBStatusBarBehaviorIgnore by default.
  // iOS only
  public static void setStatusBarBehavior(CBStatusBarBehavior statusBarBehavior)
  

Learn more about caching ▶

▲ Back to top

 

// Checks for a cached interstitial at given CBlocation.
public static function hasInterstitial(location:String):Boolean

// Checks for a cached MoreApps page at given CBlocation.
public static function hasMoreApps(location:String):Boolean

// Checks for a cached rewarded video at given CBlocation.
public static function hasRewardedVideo(location:String):Boolean

// Check to see if any views are visible.
public static function isAnyViewVisible():Boolean

// Set to enable and disable the auto cache feature. Enabled by default.
public static function setAutoCacheAds(shouldCache:Boolean):void

// Get the current auto cache behavior. Enabled by default.
public static function getAutoCacheAds():Boolean

// Set a custom identifier to send in the POST body for all Chartboost API server requests.
public static function setCustomID(customID:String):void

// Get the current custom identifier being sent in the POST body for all Chartboost API server requests.
public static function getCustomID():String

// Decide if the Chartboost SDK should show interstitials in the first session.
public static function setShouldRequestInterstitialsInFirstSession(shouldRequest:Boolean):void

//  Decide if the Chartboost SDK should show a loading view while preparing to display the MoreApps UI.
public static function setShouldDisplayLoadingViewForMoreApps(shouldDisplay:Boolean):void

// Decide if the Chartboost SDK will attempt to fetch videos from the Chartboost API servers.
public static function setShouldPrefetchVideoContent(shouldPrefetch:Boolean):void

// Set to control how the fullscreen ad units should interact with the status bar. CBStatusBarBehaviorIgnore by default.
public static function setStatusBarBehavior(statusBarBehavior:CBStatusBarBehavior):void
            

Learn more about caching ▶

▲ Back to top

 

// Checks for a cached interstitial at given CBlocation.
Bool hasInterstitial(location: String!)

// Checks for a cached MoreApps page at given CBlocation.
Bool hasMoreApps(location: String!)

// Checks for a cached rewarded video at given CBlocation.
Bool hasRewardedVideo(location: String!)

// Check to see if any views are visible.
Bool isAnyViewVisible()

// Set to enable and disable the auto cache feature. Enabled by default.
Void setAutoCacheAds(shouldCache: Bool)

// Get the current auto cache behavior. Enabled by default.
Bool getAutoCacheAds()

// Set a custom identifier to send in the POST body for all Chartboost API server requests.
Void setCustomId(customId: String!)

// Get the current custom identifier being sent in the POST body for all Chartboost API server requests.
String! getCustomId()

// Decide if the Chartboost SDK should show interstitials in the first session.
Void setShouldRequestInterstitialsInFirstSession(shouldRequest: Bool)

//  Decide if the Chartboost SDK should show a loading view while preparing to display the MoreApps UI.
Void setShouldDisplayLoadingViewForMoreApps(shouldDisplay: Bool)

// Decide if the Chartboost SDK will attempt to fetch videos from the Chartboost API servers.
Void setShouldPrefetchVideoContent(shouldPrefetch: Bool)

// Set to control how the fullscreen ad units should interact with the status bar. CBStatusBarBehaviorIgnore by default.
Void setStatusBarBehavior(statusBarBehavior: CBStatusBarBehavior)

Learn more about caching ▶

▲ Back to top

 

Amazon SDK configuration methods are the same as Android.

 


More to explore...