Release Notes: (1.3.1)
  • Updated to Chartboost iOS SDK 5.3.0.
  • Updated to Chartboost Android SDK 5.3.0.

Integration Guide - Chartboost Ad Plugin

Platforms: Android & iOS
Plugin version: 1.3.1
Chartboost iOS SDK version: 5.3.0
Chartboost Android SDK version: 5.3.0

Generally you don't have to dive into the documentation from Chartboost, simply follow a few steps below to get the plugin integrated in your App in minutes:

[1] Import the ChartboostAd[Android|IOS|Universal].unitypackage file to your unity project;

[2] Follow the instructions below to configure the plugin.

· >>> For Android platform, click on the menu item of Unity top menu bar: NeatPlug -> ChartboostAd -> Patch Android Configuration. This is for generating a valid AndroidManifest.xml or patching the existing file with ChartboostAd support.


· >>> For iOS platform, click on the menu item of Unity top menu bar: NeatPlug -> ChartboostAd -> Patch iOS Configuration. This is for automatically adding iOS SDK frameworks, libraries or patching the Info.plist file (if needed) as long as the Xcode project is generated by Unity.

[3] Find ChartboostAdAgent Prefab and ChartboostAdListener Prefab in Assets/Plugins/NeatPlug/Ads/ChartboostAd/Prefabs/, open the first scene of your game, drag & drop those two prefabs into the scene.

[4] Okay, the integration is done here. Now set up your Ad by filling in a few properties of the ChartboostAdAgent gameObject which you just dropped in the Hierarchy window. To do this, simply select that gameObject, and look at its properties in the Inspector window, you need to fill in:

   · App ID [Android|IOS] - Your Chartboost App ID for Android or IOS.

   · App Signature [Android|IOS] - Your Chartboost App Signature for Android or IOS.

   · Debug Mode - Check this if you want to see debug logs printed by the SDK.

   · Auto Load Interstitial Ad On Level Loaded - Check this if you want to display interstitial Ad automatically when a scene is loaded.

   · Show Interstitial Ad In Scenes - In which scenes(levels) you want the interstitial Ad to be shown as long as the scene is loaded.

   · Auto Load More Apps Ad On Level Loaded - Check this if you want to display MoreApps Ad automatically when a scene is loaded.

   · Show More Apps Ad In Scenes - In which scenes(levels) you want the MoreApps Ad to be shown as long as the scene is loaded.

   · Auto Load Rewarded Video Ad On Level Loaded - Check this if you want to display Rewarded Video Ad automatically when a scene is loaded.

   · Show Rewarded Video Ad In Scenes - In which scenes(levels) you want the Rewarded Video Ad to be shown as long as the scene is loaded.


     NOTE: Sample scenes with sample code can be found in Assets/Scenes/NeatPlug/Ads/ChartboostAd/.

              Please add all below 3 scenes into your Unity Build Settings -> Scenes In Build:

              SampleScene, SampleSceneNext1, SampleSceneNext2

              You need to fill in your AppID and App Signature on ChartboostAdAgent gameObject in SampleScene.

[5] Okay, the integration is done here, to use the plugin, see below:

  Call the following functions to initialize and request an Ad:

   · ChartboostAd.Instance().Init(...) - Required if you don't apply "App IDs" and "App Signatures" property value for ChartboostAdAgent.

   · ChartboostAd.Instance().LoadInterstitialAd() - Request an Interstitial Ad.

   · ChartboostAd.Instance().LoadMoreAppsAd() - Request a More Apps Ad Page.

   · ChartboostAd.Instance().LoadRewardedVideoAd() - Request a Rewarded Video Ad.

  There are other useful public methods that ChartboostAd provides, to use them, simply call ChartboostAd.Instance().methodName().
Show All   
public void Init(string appId, string appSignature, bool debugMode)
/**
 * Initialization, set the Chartboost AppId and AppSignature.
 * 
 * @param appId
 *            string - Your Chartboost App ID.
 * 
 * @param appSignature
 *            string - Your Chartboost App signature.
 * 
 * @param debugMode
 *            bool - True for debug mode on, falso for debug mode off.
 */
public void Init(string appId, string appSignature, bool debugMode)
public void LoadInterstitialAd(string location = null, bool hide = false)
/**
 * Load an Interstitial Ad.	 
 * 
 * @param location
 *           string - The location for identifying the Ad in your App.
 * 
 * @param hide
 *           bool - whether the ad should keep being invisible after loaded,
 *                  true for making the ad hidden, false for showing the 
 *                  ad immediately. if the parameter is set to true, then 
 *                  you need to programmatically display the ad by calling 
 *                  ShowInterstitialAd() after you get notified with event
 *                  OnReceiveAdInterstitial from ChartboostAdListener.
 */
public void LoadInterstitialAd(string location = null, bool hide = false)
public void ShowInterstitialAd(string location = null)
/**
 * Show the Interstitial Ad.
 * 
 * @param location
 *           string - The location for identifying the Ad in your App.
 * 
 * This sets the Interstitial ad to be visible.
 */
public void ShowInterstitialAd(string location = null)
public void LoadMoreAppsAd(string location = null, bool hide = false)
/**
 * Load a MoreApps Ad Page.	  
 *
 * @param location
 *           string - The location for identifying the Ad in your App. 
 * 
 * @param hide
 *           bool - whether the ad should keep being invisible after loaded,
 *                  true for making the ad hidden, false for showing the 
 *                  ad immediately. if the parameter is set to true, then 
 *                  you need to programmatically display the ad by calling 
 *                  ShowMoreAppsAd() after you get notified with event
 *                  OnReceiveAdMoreApps from ChartboostAdListener.
 */
public void LoadMoreAppsAd(string location = null, bool hide = false)
public void ShowMoreAppsAd(string location = null)
/**
 * Show the MoreApps Ad.
 *
 * @param location
 *           string - The location for identifying the Ad in your App.
 * 
 * This sets the MoreApps ad to be visible.
 */
public void ShowMoreAppsAd(string location = null)
public void LoadRewardedVideoAd(string location = null, bool hide = false)
/**
 * Load an RewardedVideo Ad.	 
 * 
 * @param location
 *           string - The location for identifying the Ad in your App.
 * 
 * @param hide
 *           bool - whether the ad should keep being invisible after loaded,
 *                  true for making the ad hidden, false for showing the 
 *                  ad immediately. if the parameter is set to true, then 
 *                  you need to programmatically display the ad by calling 
 *                  ShowRewardedVideoAd() after you get notified with event
 *                  OnReceiveAdRewardedVideo from ChartboostAdListener.
 */
public void LoadRewardedVideoAd(string location = null, bool hide = false)
public void ShowRewardedVideoAd(string location = null)
/**
 * Show the RewardedVideo Ad.
 * 
 * @param location
 *           string - The location for identifying the Ad in your App.
 * 
 * This sets the RewardedVideo ad to be visible.
 */
public void ShowRewardedVideoAd(string location = null)

[6] For advanced users who need to handle Ad events, read this:

  Follow the instructions to handle Ad events:

  · Select the dropped ChartboostAdListener gameObject, locate the ChartboostAdListener.cs script, open it and make some modifications.

  These callbacks are exposed in the script, you can supply your own implementations in them.
Show All   
void OnReceiveAdMoreApps() { ... }
/**
 * Fired when a More Apps Ad Page is received successfully.
 */
void OnReceiveAdMoreApps()
{
    /// Your code here...   
}
void OnFailedToReceiveAdMoreApps(string err) { ... }
/**
 * Fired when a More Apps Ad Page fails to be received.
 * 
 * @param err
 *          string - The error string
 */
void OnFailedToReceiveAdMoreApps(string err)
{
    /// Your code here...
}
void OnPresentScreenMoreApps() { ... }
/**
 * Fired when a More Apps Ad Page is presented.
 */
void OnPresentScreenMoreApps()
{
    /// Your code here...   
}
void OnDismissScreenMoreApps() { ... }
/**
 * Fired when a More Apps Ad Page screen is dismissed.
 */
void OnDismissScreenMoreApps()
{
    /// Your code here...   
}
void OnAdMoreAppsClicked() { ... }
/**
 * Fired when the MoreApps Ad Page is clicked.
 */
void OnAdMoreAppsClicked()
{
    /// Your code here...   
}
void OnReceiveAdInterstitial(string location) { ... }
/**
 * Fired when an Interstitial Ad is received successfully.
 */
void OnReceiveAdInterstitial(string location)
{
    /// Your code here...
}
void OnFailedToReceiveAdInterstitial(string location, string err) { ... }
/**
 * Fired when an Interstitial Ad fails to be received.
 *
 * @param err
 *          string - The error string
 */
void OnFailedToReceiveAdInterstitial(string location, string err)
{
    /// Your code here...
}
void OnPresentScreenInterstitial(string location) { ... }
/**
 * Fired when an Interstitial Ad screen is presented.
 */
void OnPresentScreenInterstitial(string location)
{
    /// Your code here...
}
void OnDismissScreenInterstitial(string location) { ... }
/**
 * Fired when an Interstitial Ad screen is dismissed.
 */
void OnDismissScreenInterstitial(string location)
{
    /// Your code here...
}
void OnAdInterstitialClicked(string location) { ... }
/**
 * Fired when the Interstitial Ad is clicked.
 */
void OnAdInterstitialClicked(string location)
{
    /// Your code here...   
}
void OnReceiveAdRewardedVideo(string location) { ... }
/**
 * Fired when a RewardedVideo Ad is received successfully.
 */
void OnReceiveAdRewardedVideo(string location)
{
    /// Your code here...
}
void OnFailedToReceiveAdRewardedVideo(string location, string err) { ... }
/**
 * Fired when a RewardedVideo Ad fails to be received.
 *
 * @param err
 *          string - The error string
 */
void OnFailedToReceiveAdRewardedVideo(string location, string err)
{
    /// Your code here...
}
void OnPresentScreenRewardedVideo(string location) { ... }
/**
 * Fired when a RewardedVideo Ad screen is presented.
 */
void OnPresentScreenRewardedVideo(string location)
{
    /// Your code here...
}
void OnDismissScreenRewardedVideo(string location) { ... }
/**
 * Fired when a RewardedVideo Ad screen is dismissed.
 */
void OnDismissScreenRewardedVideo(string location)
{
    /// Your code here...
}
void OnAdRewardedVideoClicked(string location) { ... }
/**
 * Fired when the RewardedVideo Ad is clicked.
 */
void OnAdRewardedVideoClicked(string location)
{
    /// Your code here...   
}
void OnAdRewardedVideoCompleted(string location, int reward) { ... }
/**
 * Fired when the Rewarded Video Play is completed.
 */
void OnAdRewardedVideoCompleted(string location, int reward)
{
    /// Your code here...   
}

[7] Build your App now. To compile for iOS platform, you need to have Xcode installed.

[8] Test and verify if the Ad can show up as expected, don't forget to test if the Ad is clickable and if the Ad window can be opened. It is suggested that you should turn on Test Mode (Test Mode can be set in Chartboost App Settings at Chartboost website.) Also it would be helpful for you to address issues if you take a look at the logcat output (Android) or xcode debug console (iOS) to find the debug / error / warning messages.

[EOF] Should you have any questions or encounter any problems while integrating the plugin, please do not hesitate to shoot us an email at support@neatplug.com, we will be more than happy to help you. Thanks for choosing NeatPlug solutions!