This SDK includes support for the following ad networks and SDK versions:
AD Network
Version
Chartboost
5.4
Applovin
2.5.3
Heyzap
8.4.1
Playhaven
2.0.0
Mopub
3.8.0
Adcolony
2.5.1
Vungle
3.0.13
Admob
6.12.2
UnityAds
8.3
AppNext
6.1.0
Facebook Audience
8.3
Simple 5 Minute Setup
Drag AppchairAdMediator into your project. Check "Copy items if needed".
Go to your project target, click on the "Build Settings" tab, and enter in -ObjC under "Other Linker Flags".
Go to your project target. Select the 'Build Phases' tab. Click on +. Add the following frameworks.
Security.framework (required)
CoreLocation.framework (required)
UIKit.framework (required)
Foundation.framework (required)
CFNetwork.framework (required)
SystemConfiguration.framework (required)
QuartzCore.framework (required)
MessageUI.framework (required)
MediaPlayer.framework (required)
CoreTelephony.framework (required)
CoreMedia.framework (required)
CoreGraphics.framework (required)
AudioToolbox.framework (required)
libsqlite3.dylib (required)
libz.1.2.5.dylib (required)
CoreFoundation.framework (required)
AVFoundation.framework (required)
EventKit.framework (required)
EventKitUI.framework (required)
WebKit.framework (optional)
Social.framework (optional)
AdSupport.framework (optional)
StoreKit.framework (optional)
To your application delegate. In didFinishLaunchingWithOptions, initialize the sdks with:
[ACAdMediator initAdNetworksWithKey:<appchair_user_id>]; //Register or login to get your appchair_user_id
Then in any view, where you would like to show an ad, use the following on ViewWillAppear:
[ACAdMediator showAds];//This will show an interstitial (or video ad) depending on your configuration on appchair in that location. Banner ads are not currently supported.
Copy all the files from the libs folder + the admediator_android.jar to the project's libs folder.
Also need to copy the files from res/drawable, res/layout to the corresponding folders.
Add the folowing declarations to you Androidmanifest.xml:
<service android:name="com.ironsource.mobilcore.MobileCoreReport" android:enabled="true"
android:exported="false" android:process=":mcServiceProcess"></service>
<receiver android:name="com.ironsource.mobilcore.InstallationTracker"
android:enabled="true" android:process=":installationTracker"></receiver>
Add the following permissions:
<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" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Add this import:
import com.fungamesandapps.admediator.AdMediator;
Initialize the sdk with the following code
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
admediator = new AdMediator();
int user_id = 1;
Show an Interstitial:
admediator.showInterstitial(false);
If you want to exit the app after the interstitial closed:
//called activity.finish() after the ad closed
@Override
public void onBackPressed() {
admediator.showInterstitial(true);
}