Prerequisites

Setup

You can import Ane packages from AMR-AIR-PACKAGES folder.

Please refer to following table for required and optional packages.

Status Name iOS Version Android Version Download Links
Required AMR Core 1.3.83 1.7.8
Optional Adcolony - 3.3.5
Optional Admob 7.35.1.0 15.0.1
Optional Applovin 5.1.2.0 8.1.3
Optional Chartboost - 7.2.1
Optional Facebook - 5.0.0
Optional Ironsource - 6.7.11
Optional Tapjoy - 12.0.0
Optional Unity Ads 2.3.0.0 2.3.0
Optional Vungle 6.3.1.1 6.3.17

iOS Setup

Add following lines to your Application.xml file.

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>
<key>NSCalendarsUsageDescription</key>
<string>Some ad content may access calendar</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Some ad content may access photos</string>

Android Setup

If you don't have play services base and basement libraries in your app, add the following ane file.

play-services-base and basement version 15.0.1

The following libraries are included in the amrCore.ane plugin. Please inform Admost business team in any duplication inconvenience.

  • recyclerview-v7-27.1.1
  • support-v4-27.1.1
  • volley-1.1.0
  • gson-2.8.0

Add the following permissions to your Application Descriptor.xml file inside the manifestAdditions tag but outside the application tag:


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

			

Add the following activities inside the application tag for your network selection on your manifestAdditions and update Applovin sdk key with yours if available :


<!-- AMR -->
<activity android:name="admost.sdk.base.AdMostDebugActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@style/AMRTheme.Transparent" />
<activity android:name="admost.sdk.base.AdMostCloseOverviewActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@style/AMRTheme.Transparent" />
<activity android:name="admost.sdk.base.AdMostTestSuiteActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@style/AMRTheme.Transparent" />
<activity android:name="admost.sdk.housead.InterstitialAd" android:configChanges="orientation|keyboardHidden|screenSize" android:hardwareAccelerated="true" />
<activity android:name="admost.sdk.base.AdMostFyberActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@style/AMRTheme.Transparent" />
				
<!-- ADMOB -->
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent"/>

<!-- UNITYADS -->
<activity android:name="com.unity3d.ads.adunit.AdUnitActivity"  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:hardwareAccelerated="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity android:name="com.unity3d.ads.adunit.AdUnitSoftwareActivity"  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:hardwareAccelerated="false" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

<!-- APPLOVIN -->
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity" android:configChanges="orientation|screenSize" />
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity" android:configChanges="orientation|screenSize" />
<meta-data android:name="applovin.sdk.key" android:value="<YOUR SDK KEY HERE>"  />
			
<!-- CHARTBOOST -->
<activity android:name="com.chartboost.sdk.CBImpressionActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:configChanges="keyboardHidden|orientation|screenSize" android:excludeFromRecents="true" android:hardwareAccelerated="true"/>

<!-- FACEBOOK -->
<activity android:name="com.facebook.ads.AudienceNetworkActivity" android:hardwareAccelerated="true" android:configChanges="keyboardHidden|orientation|screenSize" />       
				
<!-- VUNGLE -->	
<activity android:name="com.vungle.warren.ui.VungleActivity" android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize" android:launchMode="singleTop" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:name="com.vungle.warren.ui.VungleFlexViewActivity" android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize" android:hardwareAccelerated="true" android:launchMode="singleTop" android:theme="@android:style/Theme.Translucent.NoTitleBar" />
   			
<!-- ADCOLONY -->
<activity android:name="com.adcolony.sdk.AdColonyInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:hardwareAccelerated="true"/>
<activity android:name="com.adcolony.sdk.AdColonyAdViewActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:hardwareAccelerated="true"/>
								
<!-- IRONSOURCE -->
<activity android:name="com.ironsource.sdk.controller.ControllerActivity" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" />
<activity android:name="com.ironsource.sdk.controller.InterstitialActivity" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />
<activity android:name="com.ironsource.sdk.controller.OpenUrlActivity" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />

<!-- TAPJOY -->
<activity android:name="com.tapjoy.TJAdUnitActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.tapjoy.mraid.view.ActionHandler" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.mraid.view.Browser" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.TJContentActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:hardwareAccelerated="true" />

Usage

Initialization

To initialize Admost Mediation SDK, create and configure instance of an AMRSdkConfig and start the SDK with your config object.


import com.kokteyl.air.core.AMRSDK;
import com.kokteyl.air.core.AMRSdkConfig;
import com.kokteyl.air.core.AMRSDKBannerPosition;
                

var config:AMRSdkConfig = new AMRSdkConfig();
config.ApplicationIdAndroid = "<Your Android App Id>";
config.ApplicationIdIOS = "<Your IOS App Id>";

config.BannerIdAndroid = "<Your Android Banner Zone Id>";
config.BannerIdIOS = "<Your IOS Banner Zone Id>";

config.InterstitialIdAndroid = "<Your Android Interstitial Zone Id>";
config.InterstitialIdIOS = "<Your IOS Interstitial Zone Id>";

config.RewardedVideoIdAndroid = "<Your Android Video Zone Id>";
config.RewardedVideoIdIOS = "<Your IOS Video Zone Id>";

AMRSDK.startWithConfig(config);
                

To create and show a banner ad run the following code


                    AMRSDK.loadBanner(0, true); //0 top, 1 bottom
                

If you want to show a banner manually after it has loaded, pass false as the second parameter of loadBanner method and wait for the onBannerReady callback. Then call showbanner method to show banner.

Call hideBanner method to hidethe banner;


AMRSDK.hideBanner();
                

You can subscribe onBannerReady callback functions to catch banner event.


// Banner Callbacks - Optional
AMRSDK.setOnBannerReady(onBannerReady);

public function onBannerReady(networkName:String):void {}
                

Interstitial Ads

To load an Interstitial ad run the following code;


AMRSDK.loadInterstitial();
                

To show a loaded interstitial run the following code;


if (AMRSDK.isInterstitialReady())
	AMRSDK.showInterstitial();
                

You can subscribe to 4 callback functions onInterstitialReady, onInterstitialFail, show and onInterstitialDismiss to catch interstitial events.


// Interstitial Callbacks - Optional
AMRSDK.setOnInterstitialReady(onInterstitialReady);
AMRSDK.setOnInterstitialFail(onInterstitialFail);
AMRSDK.setOnInterstitialShow(onInterstitialShow);
AMRSDK.setOnInterstitialDismiss(onInterstitialDismiss);

public function onInterstitialReady(networkName:String):void {}
public function onInterstitialFail(errorMessage:String):void {}
public function onInterstitialShow(msg:String):void {}
public function onInterstitialDismiss(msg:String):void {}
                

Rewarded Ads

Rewarded video ads' integration is pretty similar to Interstitial ads with 1 additional event rewardedVideoComplete to reward the user.

To load an rewarded video ad, run the following code;


AMRSDK.loadRewardedVideo();
                

To load an rewarded video ad, run the following code;


if (AMRSDK.isRewardedVideoReady())
	AMRSDK.showRewardedVideo();
                

You can subscribe to 5 callback functions onRewardedVideoReady, onRewardedVideoFail, onRewardedVideoShow, onRewardedVideoComplete and onRewardedVideoDismiss to catch rewarded video events.


// Rewarded Video Callbacks - Optional
AMRSDK.setOnRewardedVideoReady(onRewardedVideoReady);
AMRSDK.setOnRewardedVideoFail(onRewardedVideoFail);
AMRSDK.setOnRewardedVideoShow(onRewardedVideoShow);
AMRSDK.setOnRewardedVideoComplete(onRewardedVideoComplete);
AMRSDK.setOnRewardedVideoDismiss(onRewardedVideoDismiss);

public function onRewardedVideoReady(networkName:String):void {}
public function onRewardedVideoFail(errorMessage:String):void {}
public function onRewardedVideoShow(msg:String):void {}
public function onRewardedVideoComplete(msg:String):void {}
public function onRewardedVideoDismiss(msg:String):void {}
                

Extras

Test Suite

You can use Test Suite to test your ad networks with your zone ids.

To use Test Suite in your application, you can use following code;


var version:String = Capabilities.version.substr(0,3);

// Call method with tested zone ids
if (version == "IOS")
    AMRSDK.startTestSuite(new Array("IOS_ZONE_ID", "ANOTHER_IOS_ZONE_ID"));

if (version == "AND")
    AMR.AMRSDK.startTestSuite(new Array("ANDROID_ZONE_ID", "ANOTHER_ANDROID_ZONE_ID"));

                

Android

shadowed image

iOS

shadowed image

Release Notes

In this page, you can find a record of all the changes made to this project such as bug fixes, new features, etc.

  1. Version 2.0.0
  2. Version 1.0.0

Version 2.0.0 November 13, 2018


Android

  • Admost sdk 1.7.8
  • Adcolony 3.3.5, Admob 15.0.1, Applovin 8.1.3, Chartboost 7.2.1, Facebook 5.0.0, Ironsource 6.7.11, Tapjoy 12.0.0, UnityAds 2.3.0, Vungle 6.3.17

iOS

  • Admob
  • Applovin
  • Unity Ads
  • Vungle

Version 1.0.0 February 1, 2018


  • Initial Release

Android

  • Adcolony
  • Admob
  • Applovin
  • Chartboost
  • Facebook
  • Ironsource
  • Tapjoy
  • Unity Ads
  • Vungle

iOS

  • Admob
  • Applovin
  • Facebook
  • Unity Ads
  • Vungle