AppLovinMax_iOS_Integration - imobile/app-mediation GitHub Wiki

Integration

This page shows you how to download, import, and configure the AppLovin MAX SDK.

Warning: Your build will fail if you do not build with Xcode 12 or higher. The App Store now requires apps to be built with Xcode 12. AppLovin recommends that you update Xcode to version 12.5 or higher in order to stay ahead of anticipated minimum requirements.

Note: We removed version 10.3.0 because of an issue with initializing the SDK. Please use 10.3.2 instead.

Download the Latest SDK

※ CocoaPodsを利用せずに手動でSDKを導入したい場合は弊社営業にご連絡ください。

CocoaPods (Recommended)

To integrate the AppLovin SDK through CocoaPods, first add the following line to your Podfile:

※ AppLovin MAXと共に配信するネットワークについては弊社担当営業よりご提案させていただきます。

# Sources
source 'https://github.com/CocoaPods/Specs.git'

# Settings
use_frameworks!
inhibit_all_warnings!
# Pods
target 'YOUR_PROJECT_NAME' do
    pod 'AppLovinSDK'
    pod 'AppLovinMediationGoogleAdapter'             # AdMobを利用しない場合は削除
    pod 'AppLovinMediationGoogleAdManagerAdapter'    # Ad Managerを利用しない場合は削除
    pod 'AppLovinMediationIronSourceAdapter'         # ironSourceを利用しない場合は削除
    pod 'AppLovinMediationMaioAdapter'               # maioを利用しない場合は削除
    pod 'AppLovinMediationNendAdapter'               # nendを利用しない場合は削除
    pod 'AppLovinMediationByteDanceAdapter'          # Pangleを利用しない場合は削除
    pod 'AppLovinMediationUnityAdsAdapter'           # Unity Adsを利用しない場合は削除
end

Then run the following on the command line:

pod install --repo-update

Tip: If you want to receive release updates, subscribe to our GitHub repository.

Note: The SDK requires that you set the iOS deployment target to iOS 9.0 or above.

Add your Google AdMob App ID

※ AdMobをご利用の場合は以下の設定を追加してください。

In your app’s Info.plist , add a GADApplicationIdentifier key with a String value of your AdMob App ID.

<key>GADApplicationIdentifier</key>
<string>YOUR_ADMOB_APP_ID</string>

Enable Google Ad Manager

※ Ad Managerをご利用の場合は以下の設定を追加してください。

In your app’s Info.plist , add a GADIsAdManagerApp key with the Boolean value of YES.

<key>GADIsAdManagerApp</key>
<string>YES</string>

Disable App Transport Security

※ AdMob、Ad Manager、Pangle、ironSourceをご利用の場合は以下の設定を追加してください。

Disable App Transport Security (ATS) by adding NSAppTransportSecurity to your app’s Info.plist . Then add the key NSAllowsArbitraryLoads and set it to YES . Make sure this is the only key present.

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Add the SDK Key

Open your Project Settings. Select Info. Click on one of the rows of Custom iOS Properties and click + to add a new row. Set the key in the new row to AppLovinSdkKey and set the value to your SDK key.

※ SDK keyにつきましては弊社営業からご連絡いたします。

Enable Ad Review

Related Content: “Build Superior User Experience with MAX’s Ad Review” from AppLovin’s Blog.

To enable the MAX Ad Review service, download AppLovinQualityServiceSetup-ios.rb and move it into your project folder. Open a terminal window, cd into your project folder and run:

ruby AppLovinQualityServiceSetup-ios.rb

※ AppLovinQualityServiceSetup-ios.rbにつきましては弊社営業からご提供いたします。

Initialize the SDK

Initialize the SDK in your app delegate’s application:applicationDidFinishLaunching: method.

You may want to tag users with your own internal user ID so that you can then receive that ID in an impression-level user revenue API or in S2S rewarded postbacks. If so, set the user ID before you initialize the SDK.

Note: You will see your user IDs in lowercased form in the postbacks.

// Objective-C

#import <AppLovinSDK/AppLovinSDK.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Please make sure to set the mediation provider value to @"max" to ensure proper functionality
    [ALSdk shared].mediationProvider = @"max";
    
    [ALSdk shared].userIdentifier = @"USER_ID";
    
    [[ALSdk shared] initializeSdkWithCompletionHandler:^(ALSdkConfiguration *configuration) {
        // Start loading ads
    }];

    …
// Swift

import AppLovinSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
    {
        // Please make sure to set the mediation provider value to "max" to ensure proper functionality
        ALSdk.shared()!.mediationProvider = "max"
        
        ALSdk.shared()!.userIdentifier = "USER_ID"
        
        ALSdk.shared()!.initializeSdk { (configuration: ALSdkConfiguration) in
            // Start loading ads
        }

        

SKAdNetwork

Please use the following for AppLovin SKAdNetwork IDs:

<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>2U9PT9HC89.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4FZDC2EVR5.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>7UG5ZH24HU.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>9RD848Q2BZ.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>9T245VHMPL.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>av6w8kgt66.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>F38H382JLK.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>KBD757YWX3.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ludvb6z3bs.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>M8DBW4SV7C.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>mlmmfzh3r3.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>prcb7njmu6.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>TL55SBB4FM.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>WZMMZ9FP6W.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>YCLNXRL5PM.skadnetwork</string>
</dict>
<dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ydx93a7ass.skadnetwork</string>
</dict>
⚠️ **GitHub.com Fallback** ⚠️