Getting started with the Fyber Adobe AIR Native Extension

Set up and Initialization of the ANE

1. Add the necessary ANE Fyber SDK files to your project:

  • A: For iOS use fyber-ios-sdk-1.1.4.ane
  • B: For Android use the fyber-android-sdk-1.1.4.ane and playservices-<version>.ane (Which you can generate with a script from here)

In Flash Professional CS6 or higher (currently renamed to Animate CC):

  • Create a new AIR for Android or AIR for iOS project or change the target in File > Publish Settings… > Target and select AIR for Android or iOS.
  • Under File > ActionScript Settings… > Library path, click the Browse to a Native Extension (ANE) file button and choose the Fyber SDK ANE file for your target platform
  • If your target is Android, enable the following permissions under File > AIR for Android Settings… > Permissions:

      Recommended permission to avoid making requests when the network is down
      Recommended permission to enable the video precaching service
    • Note: If you use any additional mediation partners, that extension might require additional permissions
    • Check the Manually manage permissions and manifest additions for this app box

In Flash Builder 4.6 or higher:

  • Add the ANE files to the Flex/AIR project by selecting your project in the package explorer and clicking on File > Properties
  • Select the option ActionScript Build Path > Native Extensions > Add ANE… from the properties popup.
  • Keep the Update AIR application descriptor check box checked on the pop up menu. This will automatically add the extension ID to the app descriptor.
  • Set up the platform files for your project:

  • Note: If you use any additional mediation partner, add the .ane files for each network you want to use in your app by adding them to the ActionScript Build Path.
    • The ActionScript Build Packaging > Apple iOS and/or Google Android details all the added networks.

In IntelliJ IDEA Ultimate 13 or higher:

  • Under File > Project Structure… > Modules make sure you have one module for each of your target platforms
  • Under File > Project Structure… > General make sure your project type is ActionScript (or Flex) for AIR mobile platform. You can use Change.. to have the correct type.
  • Each module should target either Android or iOS
  • Depending on your target, add the correct ANE in the Dependencies tab by using + > New Library…
  • On each of the platform tags you can generate a custom app descriptor or use the IDE generated one. You can use one for all platforms, or create one for each platform.
    • Only the generated one will include the extension IDs automatically
    • The application descriptor already contains the Android manifest and/or the iOS plist inside. You can set it up exactly like for the Flash Builder when using the custom app descriptor.
    • If you use the custom app descriptor, check that the right extension ID is added under <extensions>

2. Add the file (Android mediation only)

You can download the file here

In Flash Professional CS6 or higher (Animate CC):

  • into the root of a folder named assets created in the same place where your .fla document is.

In Flash Builder 4.6 or higher, or IntelliJ IDEA Ultimate 13 or higher:

  • into the root of your src/assets folder in your application.

The is compulsory and it provides to the SDK information about the compatible mediated networks.

That’s it! You’re ready to use the Fyber Adobe AIR Native Extension.

Using the Fyber Adobe AIR Native Extension

  1. The class that handles the Fyber integration and its callbacks will need to import the proper package, as shown in the following sample:

     import com.fyber.FyberSdk;

    Fyber singleton instance can be accessed through:

  2. Initialize the plugin using your appId, userId, and securityToken. The userId should represent a unique user identifier that does not change between sessions and clearly identifies one user in your application. If you provide a null or empty string, the userId will be automatically generated:

     var appId:String = "1234";
     var userId:String = "test_user1";
     var securityToken:String = "THE_SECURITY_TOKEN";
     var credentialsToken:String = FyberSdk.instance.start(appId, securityToken, userId);
  3. Once the plugin is initialized you’re ready to use all Fyber products.

Note: You could need to increase the Java memory configuration of the Adobe Air SDK for building Android applications. A recommended configuration example size could be _JAVA_OPTIONS="-Xms1024m -Xmx1024m", but you can tweak the values depending on your system. The workaround is described here.

Using the Offer Wall

  1. Before using this feature, make sure to initialize the Fyber SDK using the start method.

  2. To request the Offer Wall, call the method:

  3. To receive an Offer Wall result, you can register as an event listener in the SDK:

     FyberSdk.instance.addEventListener(OfferwallEvent.STATUS, onFyberOfferWallEvent);
     private function onFyberOfferWallEvent(e:OfferwallEvent):void {

Using Rewarded Video

Rewarded Video flow has two separate steps in its process - requesting offers and displaying offers.

  1. Before using this feature, make sure to initialize the Fyber SDK using the start method.

  2. To request Rewarded Video offers, call:


    If you want more control over your request, use:

     FyberSdk.instance.requestRewardedVideoAds(credentialsToken, currencyName, requestVCS, currencyId, placementId);

    currencyName allows you to override the currency name specified in the Dashboard, and the requestVCS parameter decides whether a request to VCS should be displayed immediately after finishing the video (for a currency with the specified currencyId).

  3. To listen for the Rewarded Video response, register the following event:

     FyberSdk.instance.addEventListener(RewardedVideoEvent.STATUS, onFyberRewardedVideoEvent);
     private function onFyberRewardedVideoEvent(e:RewardedVideoEvent):void {
         switch(e.status) {
             case RewardedVideoEvent.STARTED:
             case RewardedVideoEvent.CLOSE_FINISHED:
             case RewardedVideoEvent.CLOSE_ABORTED:
             case RewardedVideoEvent.AVAILABLE:
             case RewardedVideoEvent.UNAVAILABLE:
             case RewardedVideoEvent.ERROR:
                 // e.message = = A description of the error
  4. When a positive result is received (RewardedVideoEvent.AVAILABLE), it is possible to display the offer by using the following snippet:


    The RewardedVideoEvent.status field can have one of the following values:

Value Description
STARTED A Rewarded Video started.
CLOSE_FINISHED The User successfully completed the Rewarded Video and is eligible for the reward.
CLOSE_ABORTED The User cancelled the Rewarded Video before finishing it.
ERROR An unknown error occurred.
AVAILABLE The Rewarded Video is available and ready to be shown.
UNAVAILABLE Rewarded Video is not available. It is recommended to check later.

Using Interstitials

Interstitials use a similar flow as in Rewarded Video, showing a request for ads and then a call to show an ad.

  1. Before using this feature, make sure to initialize the Fyber SDK using the start method.

  2. In order to request an Interstitial, add the following snippet:

  3. To listen for the Interstitial response, register the following event:

     FyberSdk.instance.addEventListener(InterstitialEvent.STATUS, onFyberInterstitialEvent);
     private function onFyberInterstitialEvent(e:InterstitialEvent):void {
         switch(e.status) {
             case InterstitialEvent.DISMISS_REASON_UNKNOWN:
             case InterstitialEvent.DISMISS_REASON_USER_CLICKED_AD:
             case InterstitialEvent.DISMISS_REASON_USER_CLOSED_AD:
             case InterstitialEvent.ERROR:
                 // e.message = A description of the error
             case InterstitialEvent.AVAILABLE:
             case InterstitialEvent.UNAVAILABLE:
  4. When a positive result is received (InterstitialEvent.AVAILABLE), it is possible to display the Interstitial by using the following snippet:


    The e.status field can have one of the following values:

Value Description
DISMISS_REASON_UNKNOWN It is not clear what the outcome of the interstitial was.
DISMISS_REASON_USER_CLICKED_AD The User clicked on the ad.
DISMISS_REASON_USER_CLOSED_AD The User cancelled the interstitial.
ERROR There has been an error.
AVAILABLE The Interstitial is available and ready to be shown.
UNAVAILABLE The User cancelled the interstitial.

Using the Virtual Currency System

When using VCS with Rewarded Video and requestVCS is not passed as true to requestRewardedVideoAds(...), it is recommended to provide at least a three second delay after receiving a status of RewardedVideoStatus.CLOSE_FINISHED before making a request to FyberSdk.instance.requestNewCoins().

Note: If you already passed true as the requestVCS parameter to requestRewardedVideoAds(...) step 1 is optional:

  1. To use the VCS to track the reward the user has been awarded use:

     FyberSdk.instance.requestNewCoins(credentialsToken, currencyName, currencyId);

    The parameters are optional (Can also be null).

  2. The response will be provided through delegates to VCSEvent for a successful request:

     FyberSdk.instance.addEventListener(VCSEvent.STATUS, onFyberVCSEvent);
     private function onFyberVCSEvent(e:VCSEvent):void {
         switch(e.status) {
             case VCSEvent.SUCCESS:
                 // e.currencyName = Name of the currency awarded
                 // e.currencyId = ID of the currency awarded (as specified in the Fyber Dashboard)
                 // e.deltaOfCoins = Amount of coins to be given to the user
                 // e.transactionId = The latest transaction ID
             case VCSEvent.ERROR:
                 // e.errorMessage = A description of the error
                 // e.errorType = A detail of what kind of error
                 // e.errorCode = An error code

Other Features and Settings

Using an ExceptionEvent handler

You can use this event handler example to show the status message of the ExceptionEvent:



FyberSdk.instance.addEventListener(ExceptionEvent.STATUS, onFyberExceptionEvent);


private function onFyberExceptionEvent(e:ExceptionEvent):void {
	// e.message = A description of the exception

Enabling and Disabling Toast Notifications

These settings enable you to control which Toast notifications will be shown to the user.

  • Show/hide a notification after a Rewarded Video is finished, notifying the user that they will soon receive their reward:

  • Show/hide a notification after a call to the VCS, notifying the user about the amount of virtual currency they earned:


Enabling Logging

To receive more details from the plugin about the integration, it is possible to enable debug logging using:


This will provide additional information in the log including debug information about the initialization of the plugin/SDK or about 3rd party networks.

For further debug verbose information you can also listen to the native loggers:

FyberSdk.instance.addEventListener(NativeLoggerEvent.STATUS, onNativeLog);
protected function onNativeLog(event:NativeLoggerEvent):void{
    var logObject:Object = event.getLogMessageObject();
    trace( logObject.logLevel + " " +logObject.logTag+ " Message:"+logObject.logMessage);
} _The output will depend on the target platform and device._

Note: For performance reasons, please disable the debug log and remove the event listener for the NativeLoggerEvent for your production build.

Adding Parameters to the Requests

If it is desirable to send additional parameters in the requests sent from the plugin (e.g. add pub0 value), execute the following once, right before calling the start method:

var params:Dictionary = new Dictionary();
params["pub0"] = "value_of_pub0";
params["pub1"] = "value_of_pub1";

Pausing and Resuming Video Downloads

Rewarded Videos are preloaded when the SDK starts and played from the cache instead of being streamed. As a result of this feature, Rewarded Videos can play right away, improving the overall user experience of your User.

Precaching enables the videos to play faster but also uses more bandwidth. Since you might need to use this bandwidth in order to download some content when your application launches, we provide you with an API allowing you to pause and resume the downloads of Rewarded Videos.

To pause the downloads, add:


Once you are done downloading content, you can resume the downloads by adding: