Release Notes: (1.1.0)
  • Newly added Ad networks - Flurry, Samsung, Chartboost
  • A new switch - "Debug" added to SmartAdAgent.

Integration Guide - Smart Ad Plugin

Platforms: Android, iOS, Windows Phone 8
Plugin version: 1.1.0

SmartAd plugin is made for NeatPlug Ad plugin users to easily configure Ad priority among multiple Ad networks, automatically display banner Ad and (or) interstitial Ad, and more... Integrating this plugin is as simple as a few drag & drops and gameObject property changes, ZERO coding involved. Follow below steps to get it integrated in minutes :

  NOTE: SmartAd only works with other Ad plugins version 1.2.0+, please upgrade to the latest version of your existing plugins before integrating.

[1] Import the SmartAdUniversal.unitypackage file to your unity project;

[2] Find SmartAdAgent Prefab and SmartAdListener Prefab in Assets/Plugins/NeatPlug/Ads/SmartAd/Prefabs/, open the first scene of your game, drag & drop those two prefabs into the scene.

[3] Okay, the integration is done here. Now set up your Smart Ad by filling in a few properties of the SmartAdAgent 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, change these properties:

   · Disabled - Check this to disable SmartAd, do it when you need standalone Ad plugins to work without being interfered by SmartAd's Ad fail-overs.

   · Ad Priorities - The priority among listed Ad networks, item at index 0 has top priority.

   · Auto Load Banner Ad - Check this if you want to load banner Ad automatically.

   · Auto Load Interstitial On Level Loaded - Check this if you want to load interstitial Ad automatically when a level loading completes.

   · Show Banner Ad In Scenes - In which scenes(levels) you want the banner Ad to be auto-loaded. (Set size to zero for all scenes)

   · Show Interstitial Ad In Scenes - In which scenes(levels) you want the interstitial Ad to be auto-loaded. (Set size to zero for all scenes but first)

   · Banner Ad Type - Select the auto-loaded banner Ad type.

   · Banner Ad Layout - Select the auto-loaded banner Ad layout.

   · Dont Hide Bannder Ad When Loading Level - Check this if you want the Banner Ad to retain while loading level.

   · Debug - Check this if you want the debug information to be printed out.

With Auto Load Banner Ad checked, Ad will show up on device after you compile and run then. Basic users can jump to test now.

[4] For advanced users who want to take full controls on how / when an Ad would show (or preload to show later):

  If you want to control when to load the banner or interstitial Ad, uncheck the "Auto Load" properties and put following lines somewhere in your codes:

   · GameObject.Find("SmartAdAgent").SendMessage("InitLoadBannerAd");

   · GameObject.Find("SmartAdAgent").SendMessage("InitLoadInterstitialAd", false);

[5] For advanced users who need to handle Ad events, e.g. reposition the game HUD bar as long as an Ad is displayed. Read this:

  Follow the instructions to handle Ad events:

  · Select the dropped SmartAdListener gameObject, locate the SmartAdListener.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 OnReceiveAd() { ... }
/**
 * Fired when a banner Ad is received successfully.
 */
void OnReceiveAd()
{
    /// Your code here...   
}
void OnFailedToReceiveAd(string err) { ... }
/**
 * Fired when a banner Ad fails to be received.
 * 
 * @param err
 *          string - The error string
 */
void OnFailedToReceiveAd(string err)
{
    /// Your code here...
}
void OnPresentScreen() { ... }
/**
 * Fired when a Banner Ad screen is presented.
 */
void OnPresentScreen()
{
    /// Your code here...   
}
void OnDismissScreen() { ... }
/**
 * Fired when a Banner Ad screen is dismissed.
 */
void OnDismissScreen()
{
    /// Your code here...   
}
void OnLeaveApplication() { ... }
/**
 * Fired when the App loses focus after a Banner Ad is clicked.
 */
void OnLeaveApplication()
{
    /// Your code here...
}
void OnReceiveAdInterstitial() { ... }
/**
 * Fired when an Interstitial Ad is received successfully.
 */
void OnReceiveAdInterstitial()
{
    /// Your code here...
}
void OnFailedToReceiveAdInterstitial(string err) { ... }
/**
 * Fired when an Interstitial Ad fails to be received.
 *
 * @param err
 *          string - The error string
 */
void OnFailedToReceiveAdInterstitial(string err)
{
    /// Your code here...
}
void OnPresentScreenInterstitial() { ... }
/**
 * Fired when an Interstitial Ad screen is presented.
 */
void OnPresentScreenInterstitial()
{
    /// Your code here...
}
void OnDismissScreenInterstitial() { ... }
/**
 * Fired when an Interstitial Ad screen is dismissed.
 */
void OnDismissScreenInterstitial()
{
    /// Your code here...
}
void OnLeaveApplicationInterstitial() { ... }
/**
 * Fired when the App loses focus after an Interstitial Ad is clicked.
 */
void OnLeaveApplicationInterstitial()
{
    /// Your code here...
}

[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!