Release Notes: (1.0.0)
  • Initial version.

Integration Guide - Revmob Ad Plugin

Platforms: Android, IOS
Plugin version: 1.0.0
Revmob Android SDK version: 6.9.8
Revmob iOS SDK version: 8.0.2
Supported Unity3d version: 3.5.x, 4.x, 5.x

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

[1] Import the RevmobAd[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 -> RevmobAd -> Patch Android Configuration. This is for generating a valid AndroidManifest.xml or patching the existing file with RevmobAd support.


· >>> For iOS platform, click on the menu item of Unity top menu bar: NeatPlug -> RevmobAd -> 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 RevmobAdAgent Prefab and RevmobAdListener Prefab in Assets/Standard Assets/NeatPlug/Ads/RevmobAd/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 plugin by filling in a few properties of the RevmobAdAgent 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:

   · Media Id [Android|IOS] - The Media ID that you obtained from Revmob Dev Site.

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

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

   · Auto Load Banner Ad Type - Select the auto-loaded Ad type.

   · Auto Load Banner Ad Layout - Select the auto-loaded Ad layout.

   · Banner Ad Offset - Specify the auto-loaded Ad placement offset to selected Ad Layout.

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

   · Auto Load Full Screen Ad On Level Loaded - Check this if you want to load FullScreen Ad automatically.

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

With Auto Load Ad options checked, Ad will show up on device after you compile and run then. Basic users can jump straight to step [7] now.

[5] For advanced users who want to take full control of Ads, e.g. close an Ad after an In-App purchase is made, or preload an Ad for later display etc, see below:

  Call the following functions to initialize and use the plugin:

   · RevmobAd.Instance().Init(...) - Required if you don't apply "Media Id" property values for RevmobAdAgent.

   · RevmobAd.Instance().LoadBannerAd(...) - Load a Banner Ad.

   · RevmobAd.Instance().LoadFullScreenAd(...) - Load a FullScreen Ad.

   · RevmobAd.Instance().LoadLinkAd(...) - Load a Link Ad.

   · RevmobAd.Instance().LoadPopupAd(...) - Load a Popup Ad.

  There are other useful public methods that RevmobAd provides, to use them, simply call RevmobAd.Instance().methodName().
Show All   
public void LoadBannerAd(NPRevmobAd.BannerAdType adType, NPRevmobAd.AdLayout layout, int offsetX, 
                         int offsetY, bool hide)
/**
 * Load a Banner Ad.
 *
 * @param adType
 *            NPRevmobAd.BannerAdType - Type of the Banner Ad.
 *
 * @param layout
 *            NPRevmobAd.AdLayout - In which layout the Ad should display.
 *
 * @param offsetX
 *            int - The horizontal offset of the Ad, if the layout is set to left,
 *                  the offset is from the left edge of screen to the left edge of
 *                  the Ad; if the layout is set to right, the offset is from the
 *                  right edge of screen to the right edge of the Ad. 
 *                  The offset is in pixels.
 *
 * @param offsetY
 *            int - The vertical offset of the Ad, if the layout is set to top,
 *                  the offset is from the top edge of screen to the top edge of
 *                  the Ad; if the layout is set to bottom, the offset is from the
 *                  bottom edge of screen to the bottom edge of the Ad.
 *                  The offset is in pixels.
 *
 * @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
 *                  ShowBannerAd() after you get notified with event
 *                  OnReceiveAdBanner from RevmobAdListener.
 *
 */
public void LoadBannerAd(NPRevmobAd.BannerAdType adType, NPRevmobAd.AdLayout layout, int offsetX, 
                         int offsetY, bool hide)
public void LoadBannerAd(NPRevmobAd.BannerAdType adType, int top, int left, bool hide)
/**
 * Load a Banner Ad.
 *
 * @param adType
 *            NPRevmobAd.BannerAdType - Type of the Banner Ad.
 *
 * @param top
 *            int - the top margin (in pixels) for placing Ad in absolute position.
 *
 * @param left
 *            int - the left margin (in pixels) for placing Ad in absolute position.
 *
 * @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
 *                  ShowBannerAd() after you get notified with event
 *                  OnReceiveAdBanner from RevmobAdListener.
 *
 */
public void LoadBannerAd(NPRevmobAd.BannerAdType adType, int top, int left, bool hide)
public void LoadBannerAd(Vector2 adSize, NPRevmobAd.AdLayout layout, Vector2 offset, bool hide)
/**
 * Load a Banner Ad.
 *
 * @param adSize
 *            Vector2 - Customized size of the Ad.
 *                  
 *                  adSize.x - The width of the Ad, in pixels.
 *                  adSize.y - The height of the Ad, in pixels.
 *
 * @param layout
 *            NPRevmobAd.AdLayout - In which layout the Ad should display.
 *
 * @param offset
 *            Vector2 - The offset of the Ad.
 *                  
 *                  offset.x - The horizontal offset of the Ad, if the layout is set to left,
 *                  the offset is from the left edge of screen to the left edge of
 *                  the Ad; if the layout is set to right, the offset is from the
 *                  right edge of screen to the right edge of the Ad.
 *                  The offset is in pixels.
 *                  offset.y - The vertical offset of the Ad, if the layout is set to top,
 *                  the offset is from the top edge of screen to the top edge of
 *                  the Ad; if the layout is set to bottom, the offset is from the
 *                  bottom edge of screen to the bottom edge of the Ad.
 *                  The offset is in pixels.
 *
 * @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
 *                  ShowBannerAd() after you get notified with event
 *                  OnReceiveAdBanner from RevmobAdListener.
 *
 */
public void LoadBannerAd(Vector2 adSize, NPRevmobAd.AdLayout layout, Vector2 offset, bool hide)
public void ShowBannerAd()
/**
 * Show the Banner Ad.
 * This sets the banner ad to be visible.
 *
 */
public void ShowBannerAd()
public void HideBannerAd()
/**
 * Hide the Banner Ad.
 * This sets the banner ad to be invisible again.
 *
 */
public void HideBannerAd()
public void RefreshBannerAd()
/**
 * Refresh the Banner Ad.
 * This initiates a new ad request to plugin.
 *
 */
public void RefreshBannerAd()
public void RepositionBannerAd(NPRevmobAd.AdLayout layout, int offsetX, int offsetY)
/**
 * Reposition the Banner Ad.
 *
 * @param layout
 *            NPRevmobAd.AdLayout - In which layout the Ad should display.
 *
 * @param offsetX
 *            int - The horizontal offset of the Ad, if the layout is set to left,
 *                  the offset is from the left edge of screen to the left edge of
 *                  the Ad; if the layout is set to right, the offset is from the
 *                  right edge of screen to the right edge of the Ad.
 *                  The offset is in pixels.
 *
 * @param offsetY
 *            int - The vertical offset of the Ad, if the layout is set to top,
 *                  the offset is from the top edge of screen to the top edge of
 *                  the Ad; if the layout is set to bottom, the offset is from the
 *                  bottom edge of screen to the bottom edge of the Ad.
 *                  The offset is in pixels.
 *
 */
public void RepositionBannerAd(NPRevmobAd.AdLayout layout, int offsetX, int offsetY)
public void DestroyBannerAd()
/**
 * Destroy the Banner Ad.
 *
 */
public void DestroyBannerAd()
public void LoadFullScreenAd(bool hide)
/**
 * Load a FullScreen Ad.
 *
 * @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
 *                  ShowFullScreenAd() after you get notified with event
 *                  OnReceiveAdFullScreen from RevmobAdListener.
 *
 */
public void LoadFullScreenAd(bool hide)
public void ShowFullScreenAd()
/**
 * Show the FullScreen Ad.
 * This sets the FullScreen ad to be visible.
 *
 */
public void ShowFullScreenAd()
public void LoadLinkAd(bool hide)
/**
 * Load a Link Ad.
 *
 * @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
 *                  ShowLinkAd() after you get notified with event
 *                  OnReceiveAdLink from RevmobAdListener.
 *
 */
public void LoadLinkAd(bool hide)
public void ShowLinkAd()
/**
 * Show the Link Ad.
 * This sets the Link ad to be visible.
 *
 */
public void ShowLinkAd()
public void LoadPopupAd(bool hide)
/**
 * Load a Popup Ad.
 *
 * @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
 *                  ShowPopupAd() after you get notified with event
 *                  OnReceiveAdPopup from RevmobAdListener.
 *
 */
public void LoadPopupAd(bool hide)
public void ShowPopupAd()
/**
 * Show the Popup Ad.
 * This sets the Popup ad to be visible.
 *
 */
public void ShowPopupAd()
public void DisableAd()
/**
 * Disable all Ads (Banners, FullScreens, Links and Popups).
 * This function is very useful when you want to disable the Ads after
 * the user makes an In-App Purchase. In this case, you should call
 * this function in OnPurchaseCompleted() event handler of an IAP plugin.
 * This function also persists the state on the user's device so you
 * don't need to set any variable in the PlayerPrefs.
 *
 */
public void DisableAd()
public void EnableAd()
/**
 * Enable Ads (Banners, FullScreens, Links and Popups).
 * This function is for re-enabling the Ads after you called DisableAd().
 * After calling this function, you will be able to call LoadBannerAd() or
 * LoadInterstitialAd() then. And if the "Auto Load" switch is turned on, the
 * Ad will continue to be served then.
 * Persistent state is also taken care of, you don't need to set any variables
 * in the PlayerPrefs either.
 *
 */
public void EnableAd()
public bool IsAdEnabled()
/**
 * Check if Ad is enabled or not.
 * This function is for getting the current state of the Ad.
 *
 */
public bool IsAdEnabled()

[6] 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 RevmobAdListener gameObject, locate the RevmobAdListener.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   
public void OnReceiveAdBanner()
/**
 * Fired when a banner Ad is received successfully.
 *
 */
public void OnReceiveAdBanner()
public void OnFailedToReceiveAdBanner(string err)
/**
 * Fired when a banner Ad fails to be received.
 *
 * @param err
 *            string - The error string
 *
 */
public void OnFailedToReceiveAdBanner(string err)
public void OnPresentScreenBanner()
/**
 * Fired when a Banner Ad screen is presented.
 *
 */
public void OnPresentScreenBanner()
public void OnDismissScreenBanner()
/**
 * Fired when a Banner Ad screen is dismissed.
 *
 */
public void OnDismissScreenBanner()
public void OnBannerAdClicked()
/**
 * Fired when a Banner Ad is clicked.
 *
 */
public void OnBannerAdClicked()
public void OnBannerAdShown()
/**
 * Fired when a Banner Ad is shown.
 *
 */
public void OnBannerAdShown()
public void OnBannerAdHidden()
/**
 * Fired when a Banner Ad is hidden.
 *
 */
public void OnBannerAdHidden()
public void OnReceiveAdFullScreen()
/**
 * Fired when a Full Screen Ad is received successfully.
 *
 */
public void OnReceiveAdFullScreen()
public void OnFailedToReceiveAdFullScreen(string err)
/**
 * Fired when a Full Screen Ad fails to be received.
 *
 * @param err
 *            string - The error string
 *
 */
public void OnFailedToReceiveAdFullScreen(string err)
public void OnPresentScreenFullScreen()
/**
 * Fired when a Full Screen Ad screen is presented.
 *
 */
public void OnPresentScreenFullScreen()
public void OnDismissScreenFullScreen()
/**
 * Fired when a Full Screen Ad screen is dismissed.
 *
 */
public void OnDismissScreenFullScreen()
public void OnFullScreenAdClicked()
/**
 * Fired when a Full Screen Ad is clicked.
 *
 */
public void OnFullScreenAdClicked()
public void OnReceiveAdLink()
/**
 * Fired when a Link Ad is received successfully.
 *
 */
public void OnReceiveAdLink()
public void OnFailedToReceiveAdLink(string err)
/**
 * Fired when a Link Ad fails to be received.
 *
 * @param err
 *            string - The error string
 *
 */
public void OnFailedToReceiveAdLink(string err)
public void OnPresentScreenLink()
/**
 * Fired when a Link Ad screen is presented.
 *
 */
public void OnPresentScreenLink()
public void OnDismissScreenLink()
/**
 * Fired when a Link Ad screen is dismissed.
 *
 */
public void OnDismissScreenLink()
public void OnLinkAdClicked()
/**
 * Fired when a Link Ad is clicked.
 *
 */
public void OnLinkAdClicked()
public void OnReceiveAdPopup()
/**
 * Fired when a Popup Ad is received successfully.
 *
 */
public void OnReceiveAdPopup()
public void OnFailedToReceiveAdPopup(string err)
/**
 * Fired when a Popup Ad fails to be received.
 *
 * @param err
 *            string - The error string
 *
 */
public void OnFailedToReceiveAdPopup(string err)
public void OnPresentScreenPopup()
/**
 * Fired when a Popup Ad screen is presented.
 *
 */
public void OnPresentScreenPopup()
public void OnDismissScreenPopup()
/**
 * Fired when a Popup Ad screen is dismissed.
 *
 */
public void OnDismissScreenPopup()
public void OnPopupAdClicked()
/**
 * Fired when a Popup Ad is clicked.
 *
 */
public void OnPopupAdClicked()

[7] Build your App now. To compile for iOS platform, you need to have Xcode 4.5 (with iOS SDK v6) or above 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. 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) or VisualStudio debug console (WindowsPhone) 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!