Integration Guides


Adobe AIR - version 9.2.2

Full Guide

Getting Started

Ad Unit

Advanced

SDK Package

1 Overview

Follow these 5 simple steps to start monetizing:

  1. Add your app to our system and get your App ID.
  2. Download our SDK.
  3. Add the Library to your project, check out the section for Adobe Animate (former Flash Professional) or Flash Builder (former Flex Builder).
  4. In the *-app.xml of your project, add the required permissions and the fullscreenActivity code snipet (if using Fullscreen or Video ads, for Android platform).
  5. Implement our ad units as desired.

Sample App

Inside the downloaded package, you can find our Sample App.
In the revmob-flash-sample directory, you can find the RevMobSampleApp.as file that implements all of the methods and event listeners of our SDK.

2 Configuration for Adobe Animate (former Flash Professional)

  1. Add your app to our system and get your App ID.
  2. Download our SDK.
  3. Add the RevMob.ane from the .zip file downloaded to your project on the ActionScript settings
  4. You can find more details about how to include an .ane file in Adobe Animate here.
publish settings add ane

3 Configuration for Flash Builder

  1. Add your app to our system and get your App ID.
  2. Download our SDK.
  3. Add the RevMob.ane from the .zip file downloaded to your project following the instructions below:

Right-click your project in the Package Explorer and select Properties:

ane

Add the RevMob.ane in the ActionScript Build Path configuration of your project as a Native Extension:

ane

Android

Add the required permissions in your AndroidManifest.xml file by adding the following code inside the manifest tag.

<uses-permission android:name="android.permission.INTERNET"/>
			

Add the required Revmob activity in the application node if you plan to use Fullscreen, Video or Rewarded Video ad units:

<application>
	<activity android:name="com.revmob.FullscreenActivity"
		android:theme="@android:style/Theme.Translucent"
		android:configChanges="keyboardHidden|orientation">
	</activity>
</application>
			

You can include it in the Adobe Air manifestAdditions in your project config file:

<manifestAdditions>
<![CDATA[
		<manifest android:installLocation="auto">
			<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
			<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
			<uses-permission android:name="android.permission.INTERNET"/>
			<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
		</manifest>
	]]>
</manifestAdditions>
			

4 Start Session

Before showing any ads, you must start a Revmob session, i.e. initialize our SDK, which is done by creating an instance of the Revmob class.
You should start a session with the correct ID of the platform on the running device.
It's a best practice to do this as soon as your app is ready, so you can call ads easily whenever you want to.

{
    import com.revmob.airextension.RevMob;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    public class RevMobExtensionSample extends Sprite {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_FOR_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_FOR_IOS>";
        var revmob:RevMob;
        public function RevMobExtensionSample() {
            super();
            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            // This line is the start session code per say
            revmob = new RevMob(appId);
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
    }
}
            

Remember that the start session is an asynchronous call, so you should catch the callback event to know when the SDK is ready to show your ads.
You can learn more about how to catch the events fired in the Event Listener section.

5 Testing

While you're developing your app, you will only receive test ads. Your app must make at least one ad request while on test mode in order to be validated before receiving live ads. Be sure you are able to receive at least one of our sample ads and that it’s redirecting to our "Success Page" when clicked. Once you are able to receive our sample ads it means you’ve successfully integrated our sdk.

sample_ads

Fullscreen sample, Banner sample, and Success Page

6 Go Live

Once you're finished and your app is in the store with our SDK, click on the "Go live" button in your Apps page and insert your app's URL. It may take up to 48h for your app to be approved. After that, it will start receiving live ads.

app_store_idfa

7 Kids Category

Apps designed for families have special regulations for monetizing. As stated in Google Play's guidelines and in Apple's guidelines, they may not include behavioral advertising and the ads must be appropriate for kids.
Revmob is fully COPPA compliant. To specify that your app is designed for kids and to guarantee that it's fully compliant, you must set the user minimum age when your user is 13 or less years old:

revmob.setUserAge(10);
            

You also can not display a fullscreen ad immediately upon app launch nor show more than one ad placement per page.

Attention
This method is only to protect children from abusive advertising. Setting the user age incorrectly may affect your eCPM due to our algorithms using this information for retargeting.

8 Upload to App Store

When uploading your app to App Store with Revmob SDK, you will be asked about the use of IDFA.
Revmob uses IDFA for targeting purposes. Check "Yes" on the option at the right side of the page, as it will improve your earnings a lot.
Then, on the last three checkboxes:

  1. Check this box to serve ads.
  2. Check this box if you are also advertising the app you are uploading, and its installations will be tracked.
  3. This check is optional, as it's not used by Revmob.
app_store_idfa

1 Native Button/Link

You have full control over this ad unit's layout. You design it, attach our method to its click event and the user will be redirected to the Play/App Store, according to their operating system.
A common usage is to associate it to a "more games" button or to a custom banner your team designed.
Keep in mind that the image associated with this link must be clearly identified as an advertising.

Implementation

The best implementation is to pre-cache the ad and only display the button when receiving its RevMobAdsEvent callback:

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_FOR_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_FOR_IOS>";
        var revmob:RevMob;
        public function SampleApp()
        {
            super();
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.LINK_RECEIVED, onAdsEvent );
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    //here the ad is being pre-cached
                    revmob.createAdLink();
                    break;
                }
                case RevMobAdsEvent.LINK_RECEIVED:
                {
                    //Ad being displayed after the load completion event
                    revmob.openAdLink();
                    break;
                }
            }
        }
    }
}
            

You can also only call the openAdLink() method when clicked:

revmob.openAdLink();
// This code redirects the user to the store, so you should trigger it when your button is clicked
            

You can learn more about RevMobAdsEvent in the Event Listener section.

Reminder:
Before calling any of our ads, you must start a Revmob session, otherwise ads won't be shown.
See here how to start a Revmob session.

ant_smasher_native

100-million-downloads Ant Smasher's success case.

2 Fullscreen

The Interstitial is an advertisement that fills the whole screen. It's usually shown:

  1. On app start;
  2. Before/after a game round;
  3. After a service is used (e.g. alarm turned off).

When pre-caching, the ad received can either be a static interstitial or a video ad. Our servers will always return the one that can pay you more.

Make sure you declare Revmob's FullscreenActivity on your *-app.xml file of your project!

<manifestAdditions>
<![CDATA[
        <manifest android:installLocation='auto'>
            <uses-permission android:name="android.permission.INTERNET"/>
            <application android:enabled="true">
                <activity android:name="com.revmob.ads.fullscreen.FullscreenActivity"
                    android:configChanges="keyboardHidden|orientation">
                </activity>
            </application>
        </manifest>
    ]]>
</manifestAdditions>
            

Implementation

You should pre-cache the ad before showing it with the createFullscreen() and showLoadedFullscreen() methods.

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_FOR_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_FOR_IOS>";
        var revmob:RevMob;
        public function SampleApp()
        {
            super();
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_RECEIVED, onAdsEvent );
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    //here the ad is being pre-cached
                    revmob.createFullscreen();
                    break;
                }
                case RevMobAdsEvent.FULLSCREEN_RECEIVED:
                {
                    //Ad being displayed after the load completion event
                    revmob.showLoadedFullscreen();
                    break;
                }
            }
        }
    }
}
            

You can also only call the basicUsageFullscreen() method when clicked:

revmob.basicUsageFullscreen();
// This code will load the ad and display it on screen as soon as it completes loading
            

Using this method can affect the UX as the loading of the ad may take a long time due to user's net speed.
That's why we recommend you to pre-cache your ads and serve them after receiving the event that the ad was completely loaded, as it will improve UX.
You can learn more about RevMobAdsEvent in the Event Listener section.

Reminder:
Before calling any of our ads, you must start a Revmob session, otherwise ads won't be shown.
Check here how to start a Revmob session.

ant_smasher_fullscreen

Revmob's Fullscreen test ad.

3 Banner

Banner ad is a View with the standard size of 320x50 for phones and 728x90 for tablets, though you can customize it for your app.
You can use it in 2 different ways:

  • Basic Banner
  • Custom Banner

Basic Banner

This method is the simplest way to show a banner ad.
The banner will be displayed at the bottom of the screen, with its specific width.
You should pre-cache the ad before showing it using the loadBanner() and showBanner() methods:

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_IOS>";
        var revmob:RevMob;
        public function SampleApp()
        {
            super();
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    //Ad being loaded after Start Session completion event
                    revmob.loadBanner();
                    break;
                }
                case RevMobAdsEvent.BANNER_RECEIVED:
                {
                    //Ad being shown after it has been completely received
                    revmob.showBanner();
                    break;
                }
            }
        }
    }
}
            

To hide the basic banner, just write the code below:

revmob.hideBanner();
            

If you hide the ad, you can call showBanner() to show the same add. To request a new banner, you have to release the old ad and then call loadBanner() again.

revmob.releaseBanner();
            

Custom Banner

You can display a banner with custom positioning and size. The origin will always be the top left corner of the screen.
You should pass 4 Int value parameters to the load and show methods:
loadCustomBanner(leftMargin, topMargin, bannerWidth, bannerHeight)
showCustomBanner(leftMargin, topMargin, bannerWidth, bannerHeight)

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_IOS>";
        var revmob:RevMob;
        public function SampleApp()
        {
            super();
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    //Ad being loaded after Start Session completion event
                    revmob.loadCustomBanner(0, 200, 320, 50);
                    break;
                }
                case RevMobAdsEvent.BANNER_RECEIVED:
                {
                    //Ad being shown after it has been completely received
                    revmob.showCustomBanner(0, 200, 320, 50);
                    break;
                }
            }
        }
    }
}
            

To hide the custom banner, just write the code below:

revmob.hideCustomBanner();
            

If you hide the ad, you can call showBanner() to show the same add. To request a new banner, you have to release the old ad and then call loadBanner() again.

revmob.releaseCustomBanner();
            

Reframing

You can reframe your custom banner for situations like when there is a screen rotation.
All you need to do is call the following method with the new parameters:

revmob.customBannerOrientationChanged(0, 100, 320, 50);
            

Reminder:
Before calling any of our ads, you must start a Revmob session, otherwise, ads won't be shown. See here how to start a Revmob session.

ant_smasher_banner

100-million-downloads Ant Smasher's home menu banner.

4 Video

To show a video ad, you must call the createVideo method. A good place to call this method is after the startSession.
Then, when you receive a callback from our onRevMobVideoLoaded listener, you can call the showVideo method. A good place to call this method is after a game over, for example.
Don't forget to declare Revmob's FullscreenActivity on your *-app.xml file of your project.

<manifestAdditions>
<![CDATA[
        <manifest android:installLocation='auto'>
        <uses-permission android:name="android.permission.INTERNET"/>
            <application android:enabled="true">
                <activity android:name="com.revmob.ads.fullscreen.FullscreenActivity"
                    android:configChanges="keyboardHidden|orientation">
                </activity>
            </application>
        </manifest>
    ]]>
</manifestAdditions>
            

Basic Usage

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_IOS>";
        var revmob:RevMob;
        public function SimpleBuilderAir()
        {
            super();
            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.VIDEO_LOADED, onAdsEvent );
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    revmob.createVideo();
                }
                case RevMobAdsEvent.VIDEO_LOADED:
                {
                    revmob.showVideo();
                }
            }
        }
    }
}
            

Listeners Usage

These are the Revmob Listeners that fire on video ads events:

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_IOS>";
        var revmob:RevMob;
        public function SimpleBuilderAir()
        {
            super();
            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.SESSION_NOT_STARTED, onAdsEvent );
            //Video Events
            revmob.addEventListener( RevMobAdsEvent.VIDEO_LOADED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.VIDEO_NOT_COMPLETELY_LOADED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.VIDEO_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.VIDEO_DISMISS, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.VIDEO_CLICKED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.VIDEO_NOT_PRELOADED, onAdsEvent );
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                //START SESSION EVENTS
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    //Fired when session has been completely started
                    revmob.createVideo();
                    revmob.printEnvironmentInformation();
                    break;
                }
                case RevMobAdsEvent.SESSION_NOT_STARTED:
                {
                    //Fired when session has not been completely started
                    trace(event.error);
                    break;
                }
                //VIDEO EVENTS
                case RevMobAdsEvent.VIDEO_LOADED:
                {
                    //Fired when the video was completely loaded
                    break;
                }
                case RevMobAdsEvent.VIDEO_NOT_RECEIVED:
                {
                    //Fired when there was a problem downloading the video
                    break;
                }
                case RevMobAdsEvent.VIDEO_STARTED:
                {
                    //Fired when the video has started playing
                    break;
                }
                case RevMobAdsEvent.VIDEO_CLICKED:
                {
                    //Fired when the video was clicked
                    break;
                }
                case RevMobAdsEvent.VIDEO_DISMISS:
                {
                    //Fired when the video was dismissed
                    break;
                }
                case RevMobAdsEvent.VIDEO_NOT_PRELOADED:
                {
                    //Fired when you try to show a videoAd without pre-caching it first
                    break;
                }
            }
        }
    }
}
            
ant_smasher_video

Revmob's Video test ad

5 Rewarded Video

The most common way to display Rewarded Videos is by disclaiming that a video will be shown, and that the user will earn something for watching the ad.
To use Revmob Rewarded Video Ads, you must pre-cache them before they're displayed. To pre-cache, call the createRewardedVideo() method and to display the ad, call the showRewardedVideo() method.
Don't forget to declare Revmob's FullscreenActivity on your *-app.xml file of your project.

<manifestAdditions>
<![CDATA[
        <manifest android:installLocation='auto'>
        <uses-permission android:name="android.permission.INTERNET"/>
            <application android:enabled="true">
                <activity android:name="com.revmob.ads.fullscreen.FullscreenActivity"
                    android:configChanges="keyboardHidden|orientation">
                </activity>
            </application>
        </manifest>
    ]]>
</manifestAdditions>
            

Basic Usage

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_IOS>";
        var revmob:RevMob;
        public function SimpleBuilderAir()
        {
            super();
            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_LOADED, onAdsEvent );
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    revmob.createRewardedVideo();
                }
                case RevMobAdsEvent.REWARDED_VIDEO_LOADED:
                {
                    revmob.showRewardedVideo();
                }
            }
        }
    }
}
            

Listeners Usage

These are all the Revmob listeners that fire on rewarded video ads events:

package
{
    import com.revmob.airextension.RevMob;
    import com.revmob.airextension.events.RevMobAdsEvent;
    import flash.display.SimpleButton;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.system.Capabilities;
    import flash.events.MouseEvent;
    public class SampleApp extends Sprite
    {
        private static const ANDROID_APP_ID:String = "<YOUR_APP_ID_ANDROID>";
        private static const IOS_APP_ID:String = "<YOUR_APP_ID_IOS>";
        var revmob:RevMob;
        public function SimpleBuilderAir()
        {
            super();
            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
            var appId:String = null;
            if (isIOS()) {
                appId = IOS_APP_ID;
            } else if (isAndroid()) {
                appId = ANDROID_APP_ID;
            }
            revmob = new RevMob(appId);
            revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.SESSION_NOT_STARTED, onAdsEvent );
            //Video Events
            revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_LOADED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_NOT_RECEIVED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_STARTED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_COMPLETED, onAdsEvent );
            revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_NOT_PRELOADED, onAdsEvent );
        }
        protected static function isIOS():Boolean {
            return Capabilities.os.toLowerCase().indexOf("ip") > -1;
        }
        protected static function isAndroid():Boolean {
            return Capabilities.os.toLowerCase().indexOf("linux") > -1;
        }
        private function onAdsEvent( event:RevMobAdsEvent ):void {
            switch(event.name)
            {
                //START SESSION EVENTS
                case RevMobAdsEvent.SESSION_STARTED:
                {
                    //Fired when session has been completely started
                    revmob.createRewardedVideo();
                    revmob.printEnvironmentInformation();
                    break;
                }
                case RevMobAdsEvent.SESSION_NOT_STARTED:
                {
                    //Fired when session has not been completely started
                    trace(event.error);
                    break;
                }
                //REWARDED VIDEO EVENTS
                case RevMobAdsEvent.REWARDED_VIDEO_LOADED:
                {
                    //Fired when the rewarded video was completely loaded
                    revmob.showRewardedVideo();
                    break;
                }
                case RevMobAdsEvent.REWARDED_VIDEO_NOT_RECEIVED:
                {
                    //Fired when there was a problem downloading the rewarded video
                    trace(event.error);
                    break;
                }
                case RevMobAdsEvent.REWARDED_VIDEO_STARTED:
                {
                    //Fired when the rewarded video has started playing
                    break;
                }
                case RevMobAdsEvent.REWARDED_VIDEO_COMPLETED:
                {
                    //Fired when the rewarded video has completed
                    break;
                }
                case RevMobAdsEvent.REWARDED_VIDEO_NOT_PRELOADED:
                {
                    //Fired when you try to show a rewarded video ad without pre-caching it first
                    break;
                }
            }
        }
    }
}
            
ant_smasher_video

Revmob's Video test ad

1 Event Listeners

With Listeners (also known as Delegates or Callbacks) you can follow the ad workflow. The Revmob SDK will fire events for every important change in the ad state. For example, you can identify if the ad was loaded successfully or if the user clicked on the ad.
First of all, you will have to import the event listener in your application.

import com.revmob.airextension.events.RevMobAdsEvent;
            

Register the events that you want to listen for in your initialization function. The event listener funcion will call your custom function when the desired event is triggered in the SDK.

Start Session

revmob.addEventListener( RevMobAdsEvent.SESSION_STARTED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.SESSION_NOT_STARTED, onAdsEvent );
            

Basic Usage Fullscreen

revmob.addEventListener( RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_DISMISSED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_CLICKED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_DISPLAYED, onAdsEvent );
            

Fullscreen

revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_DISMISSED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_CLICKED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_DISPLAYED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.FULLSCREEN_NOT_PRELOADED, onAdsEvent );
            

Banner

revmob.addEventListener( RevMobAdsEvent.BANNER_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BANNER_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BANNER_DISMISSED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BANNER_CLICKED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.BANNER_DISPLAYED, onAdsEvent );
            

Custom Banner

revmob.addEventListener( RevMobAdsEvent.CUSTOM_BANNER_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.CUSTOM_BANNER_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.CUSTOM_BANNER_DISMISSED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.CUSTOM_BANNER_CLICKED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.CUSTOM_BANNER_DISPLAYED, onAdsEvent );
            

Native Link

revmob.addEventListener( RevMobAdsEvent.LINK_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.LINK_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.LINK_CLICKED, onAdsEvent );
            

Video

revmob.addEventListener( RevMobAdsEvent.VIDEO_LOADED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.VIDEO_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.VIDEO_STARTED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.VIDEO_CLICKED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.VIDEO_DISMISSED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.VIDEO_NOT_PRELOADED, onAdsEvent );
            

Rewarded Video

revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_LOADED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_NOT_RECEIVED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_STARTED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_COMPLETED, onAdsEvent );
revmob.addEventListener( RevMobAdsEvent.REWARDED_VIDEO_NOT_PRELOADED, onAdsEvent );
            

Handling Events

The custom function onAdsEvent is defined below to handle the callback events.

Start Session

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //START SESSION EVENTS
        case RevMobAdsEvent.SESSION_STARTED:
        {
            //Start session successfully completed
            break;
        }
        case RevMobAdsEvent.SESSION_NOT_STARTED:
        {
            //Start session not completed
            break;
        }
    }
}
            

Basic Usage Fullscrren

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //BASIC USAGE FULLSCREEN EVENTS
        case RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_RECEIVED:
        {
            //Basic usage fullscreen successfully loaded
            break;
        }
        case RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_NOT_RECEIVED:
        {
            //Basic usage fullscreen not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_DISPLAYED:
        {
            //Basic usage fullscreen displayed
            break;
        }
        case RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_DISMISSED:
        {
            //Basic usage fullscreen dismissed
            break;
        }
        case RevMobAdsEvent.BASIC_USAGE_FULLSCREEN_CLICKED:
        {
            //Basic usage fullscreen clicked
            break;
        }
    }
}
            

Fullscreen

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //FULLSCREEN EVENTS
        case RevMobAdsEvent.FULLSCREEN_RECEIVED:
        {
            //Fullscreen successfully loaded
            break;
        }
        case RevMobAdsEvent.FULLSCREEN_NOT_RECEIVED:
        {
            //Fullscreen not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.FULLSCREEN_DISPLAYED:
        {
            //Fullscreen displayed
            break;
        }
        case RevMobAdsEvent.FULLSCREEN_DISMISSED:
        {
            //Fullscreen dismissed
            break;
        }
        case RevMobAdsEvent.FULLSCREEN_CLICKED:
        {
            //Fullscreen clicked
            break;
        }
        case RevMobAdsEvent.FULLSCREEN_NOT_PRELOADED:
        {
            //Fullscreen not preloaded
            break;
        }
    }
}
            

Banner

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //BANNER EVENTS
        case RevMobAdsEvent.BANNER_RECEIVED:
        {
            //Banner successfully loaded
            break;
        }
        case RevMobAdsEvent.BANNER_NOT_RECEIVED:
        {
            //Banner not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.BANNER_DISPLAYED:
        {
            //Banner displayed
            break;
        }
        case RevMobAdsEvent.BANNER_DISMISSED:
        {
            //Banner dismissed
            break;
        }
        case RevMobAdsEvent.BANNER_CLICKED:
        {
            //Banner clicked
            break;
        }
    }
}
            

Custom Banner

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //CUSTOM BANNER EVENTS
        case RevMobAdsEvent.CUSTOM_BANNER_RECEIVED:
        {
            //Custom banner successfully loaded
            break;
        }
        case RevMobAdsEvent.CUSTOM_BANNER_NOT_RECEIVED:
        {
            //Custom banner not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.CUSTOM_BANNER_DISPLAYED:
        {
            //Custom banner displayed
            break;
        }
        case RevMobAdsEvent.CUSTOM_BANNER_DISMISSED:
        {
            //Custom banner dismissed
            break;
        }
        case RevMobAdsEvent.CUSTOM_BANNER_CLICKED:
        {
            //Custom banner clicked
            break;
        }
    }
}
            

Native Link

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //LINK EVENTS
        case RevMobAdsEvent.LINK_RECEIVED:
        {
            //Native link successfully loaded
            break;
        }
        case RevMobAdsEvent.LINK_NOT_RECEIVED:
        {
            //Native link not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.LINK_CLICKED:
        {
            //Native link clicked
            break;
        }
    }
}
            

Video

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //VIDEO EVENTS
        case RevMobAdsEvent.VIDEO_LOADED:
        {
            //Video successfully loaded
            break;
        }
        case RevMobAdsEvent.VIDEO_NOT_RECEIVED:
        {
            //Video not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.VIDEO_STARTED:
        {
            //Video started
            break;
        }
        case RevMobAdsEvent.VIDEO_CLICKED:
        {
            //Video clicked
            break;
        }
        case RevMobAdsEvent.VIDEO_DISMISSED:
        {
            //Video dismissed
            break;
        }
        case RevMobAdsEvent.VIDEO_NOT_PRELOADED:
        {
            //Video not preloaded
            break;
        }
    }
}
            

Rewarded Video

private function onAdsEvent( event:RevMobAdsEvent ):void {
    switch(event.name)
    {
        //REWARDED VIDEO EVENTS
        case RevMobAdsEvent.REWARDED_VIDEO_LOADED:
        {
            //Rewarded video successfully loaded
            break;
        }
        case RevMobAdsEvent.REWARDED_VIDEO_NOT_RECEIVED:
        {
            //Rewarded video not loaded
            trace(event.error);
            break;
        }
        case RevMobAdsEvent.REWARDED_VIDEO_STARTED:
        {
            //Rewarded video started
            break;
        }
        case RevMobAdsEvent.REWARDED_VIDEO_COMPLETED:
        {
            //Rewarded video completed
            break;
        }
        case RevMobAdsEvent.REWARDED_VIDEO_NOT_PRELOADED:
        {
            //Rewarded video not preloaded
            break;
        }
    }
}
            

1 Change Log (yyyy/mm/dd)

9.2.1 (2016/09/08)

  • ImportantUpdate Improved Android banner pre caching

9.2.0 (2016/08/17)

  • ImportantBugfix Improved memory performance.
  • New Added Load and Release Banner.
  • Update Improved Video Ad UX.
  • Bugfix Fixed minor bugs.

9.1.0 (2016/05/11)

  • NewImportantBugfix Passed through new extensive Quality Assurance procedures.
  • Bugfix Fixed AD_NOT_RECEIVED listener being fired on some click events on Android.

9.0.5 (2015/09/07)

  • Bugfix Fixes startSession crash on Android.

9.0.4 (2015/09/02)

  • New Added RevMob Button ad unit.
  • Bugfix Fixes an important issue affecting part of the clicks, lowering the eCPM.
  • Important Many internal improvements and performance enhances.

9.0.3 - 2015/06/22

  • New Added video ads, rewarded video ads and support to VAST.
  • New Refreshable banners.
  • Important Many internal improvements and performance enhances.

1.5.0 - 2015/04/07

  • Important Added x86_64 architecture support due to Apple's new requirement.
  • New Added refreshable banners.

1.4.5 - 2014/11/28

  • Important Fixes violations in the newest Google's Policy for advertising
  • Important Fixes issues that were causing the SDK to be flagged by some antivirus

1.4.4 - 2014/11/03

  • NewImportant Internal improvements and extra features for both iOS and Android.

1.4.3 - 2014/09/10

  • NewImportant iOS Video Ads support.
  • NewImportant Android L compatibility.
  • NewImportant iOS 8 compatibility.

1.4.2 - 2014/07/18

  • NewImportant Support for Google ID for Advertisement for Android (details).
  • NewImportant New listeners for Android for Eula popup window (details).
  • NewImportant New listeners for iOS and Android for start session (documentation).
  • ImportantBugfix Status bar was being shown even if the app was hiding it for iOS.
  • ImportantBugfix Fixed an issue that crashes the app if IDFV returns nil for iOS.
  • ImportantBugfix Banner was being shown in front of the keyboard for iOS.
  • ImportantBugfix Session could not be started if it failed in the first time for iOS.
  • ImportantBugfix Click listener for fullscreen was being called twice for Android.

1.4.1 - 2014/04/15

  • ImportantBugfix Fixes bug on iOS that could lead to "SESSION NOT STARTED" warning.

1.4.0 - 2014/02/18

  • new Preload for fullscreen, banner, popup and link.

1.3.1 - 2014/02/17

  • ImportantBugfix Fixed an issue that resulted in error "422 - Device requirements not met".

1.3.0 - 2014/02/14

  • ImportantBugfix Fixed an issue that could prevent AppStore to open.
  • Update Internal improvements for iOS releases.

1.2.0 - 2013/12/06

  • new You can set size and position to the banner.
  • Bugfix Orientation change problem with banners.

1.1.1 - 2013/11/05

  • Update Internal improvements for Android releases.
  • Update Internal improvements for iOS releases.

1.1.0 - 2013/10/09

  • new Basic banner for Android and iOS.

1.0.0 - 2013/09/18

  • NewImportant Support to iOS 7 GM (arm64 architecture are not supported yet).
  • Important Dropped support to iOS 4.
  • Update Important internal improvements for Android releases.
  • Update Important internal improvements for iOS releases.

0.6.4 - 2013/08/13

  • new Adobe Flash sample app.

0.6.3 - 2013/08/01

  • Update Important internal improvements for iOS releases.

0.6.2 - 2013/07/24

  • Update Important internal improvements for Android releases.
  • Update Important internal improvements for iOS releases.

0.6.1 - 2013/06/27

  • new Hide fullscreen function for Android and iOS.
  • new Listener for events on Android and iOS.
  • new Sample App with Flex 3.7 interface.
  • Bugfix Fixed some issues on Android related to Fullscreen ads.

0.6.0 - 2013/06/06

  • Update Important internal improvements for Android releases.
  • Update Important internal improvements for iOS releases.
  • Optimization Using less memory in Android fullscreen.

0.5.1 - 2013/04/08

  • New iOS do not collect UDID anymore (More info).
  • Update Improvements on Logs.
  • Update Lots of internal improvements that will increase eCPM.
  • Update Android permissions validations (logs to alert implementation issues).
  • Bugfix Fixed an issue on iOS that can cause a click fail on fullscreen.
  • Bugfix Fixed some issues on iOS that can prevent the notification of errors in clicks.
  • Bugfix Fixed some issues on iOS that can cause memory leaks.

0.5.0 - 2013/02/27

  • Update Many internal improvements on iOS and Android platforms.

0.4.1 - 2013/02/21

  • Update Sample app.
  • Update Many internal improvements on iOS and Android platforms.
  • Update Support to iOS 6.1, minimum iOS version supported is 4.3.

0.4.0 - 2012/10/11

  • Update Android and iOS revmob sdks.
  • New Open in app iTunes.

0.3.0 - 2012/10/08

  • Bugfix Prefixed iOS functions to avoid conflicts with other extensions.

0.2.0 - 2012/09/18

  • New Added open ad link
  • New Testig mode