Skip to content

iOS SDK Setup

Mert Celik edited this page Sep 20, 2018 · 9 revisions

Initialization

In order to receive any type of advertisement, you should initialize Appmediation SDK first. To initialize Appmediation SDK, call the method below:

[AMSDK initWithAppKey:YOUR_APP_KEY];

N.B.: Get your app key from here.

Calling initialization method as early as possible on your applications' session will help to receive ads faster.

Auto Loading

Appmediation SDK currently supports banners, interstitials and rewarded videos for auto-loading.

- AppmediationAdTypeBanner
- AppmediationAdTypeInterstitial
- AppmediationAdTypeRewarded

If you want Appmediation SDK to handle ad requests and loadings for you, you need to set ad types to auto load. You can do it by calling method below:

[AMSDK autoLoad:AppmediationAdTypeRewarded];

or if you want to combine multiple formats, you can use | operator:

[AMSDK autoLoad:AppmediationAdTypeRewarded | AppmediationAdTypeInterstitial];

GDPR

You need to obtain end-users' consent from EU/EEA zone users before using our advertising services. We have developed two options you can use:

Automatic Consent Collection

Appmediation SDK comes with this function enabled by default. With this functionality, we check the user's location and if the user is in the EU/EEA zone, we show them the consent message. If the user is outside of the EU/EEA zone, we do not bother them with GDPR consent message at all!

If you want to disable this functionality and use the manual collection, please disable it by:

[AMSDK autoGDPRConsent:NO];

Manual Consent Collection

If you have your own GDPR message and collect consent from your own view, please pass the collected consent value to the method below and you are all set!

[AMSDK setUserConsent:YES];

Integration Checker

Appmediation SDK 2.0 includes a tool for verifying the integration of adapters and ad network SDKs. It checks the compatibility between adapters and SDK versions. In order to check your integration and get the report from the debugger, please call:

[AMIntegrationChecker validateIntegration];

This checker becomes very useful if you would like to update modular pieces of our product without updating all pieces.

N.B.: If you intentionally choose not to add some adapters, they will appear as ⛔️. If everything is correct you should see all ✅ for that network.

Test Mode

If you want to test your integration with our test ads, set test mode by calling:

[AMSDK setTestMode:YES]; // Set before initialization

N.B.: You can also enable/disable test mode from your dashboard.

Debugging

Appmediation SDK provides 3 levels of logging:

- kAMSDKLogLevelError
- kAMSDKLogLevelInfo
- kAMSDKLogLevelDebug

Error level logging is enabled by default. If you would like to change logging level, you can use the method provided below:

[AMSDK setLogLevel:kAMSDKLogLevelDebug];

User Identifier

You can set a user identifier by calling:

[AMSDK setUserIdentifier:@"player1234"];

N.B.: Currently this feature is only used by server to server rewarded video callbacks. You MUST set this value if you want to use server to server callbacks.

Clone this wiki locally