Integration
此内容尚不支持你的语言。
This page shows you how to download, import, and configure the AppLovin MAX SDK.
Download the Latest SDK
You can download the SDK through CocoaPods as a dependency. If you prefer to integrate manually, follow the instructions here. If you prefer to integrate using Swift Package Manager, follow the instructions here.
The SDK requires the minimum iOS deployment target to be iOS 11.0 or above. It also requires Xcode version 15 or above.
To receive release updates, subscribe to the AppLovin iOS MAX SDK GitHub repository.
Swift Compatibility
To ensure your build is compatible with artifacts that contain Swift, set Build Settings > Always Embed Swift Standard Libraries to YES.
If you use Swift and build for iOS 12.2.0 or earlier, add /usr/lib/swift
to Build Settings > Runpath Search Paths.
This prevents issues with libswiftCore.dylib
.
CocoaPods
To integrate the AppLovin SDK through CocoaPods:
- Add the following line to your Podfile:
- Run the following on the command line:
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 its value to your SDK key.
You can find your SDK key in the Account > General > Keys section of the AppLovin dashboard.
Integrate Custom SDK Adapters
AppLovin Exchange (ALX) supports a custom adapter for LinkedIn. Integration instructions are below, and more information can be found here.
To install the adapter:
- Add the following line to your Podfile:
- Run the following on the command line:
Enable Ad Review
To enable the MAX Ad Review service, you must log in to your AppLovin account.
Then download AppLovinQualityServiceSetup-ios.rb
and move it into your project folder.
Open a terminal window, cd
into your project folder and run:
Initialize the SDK
Initialize the SDK in your app delegate’s application:applicationDidFinishLaunching:
method.
Ad assets that are fully cached result in a better user experience. For this reason, always initialize the AppLovin SDK on startup. This gives mediated networks the maximum amount of time to cache ads. This is especially important with video ads.
iOS 14 Support
In iOS 14, Apple introduced global privacy policy changes. Apple requires applications to comply with these new policies. If you fail to comply, you may lose revenue. This section explains how to comply.
SKAdNetwork
Update your app’s Info.plist
with network-specific identifiers.
See the SKAdNetwork documentation for instructions.
Consent and Data APIs
You must obtain consent from your users in certain jurisdictions on behalf of AppLovin’s monetization partners. You must also correctly pass consent values to AppLovin. To learn how to do these things, review the Privacy–Consent, Age-Related Flags, and Data APIs documentation.
iOS 15 Global SKAdNetwork Reporting
Starting with iOS 15, Apple allows developers to send a copy of their SKAdNetwork install postbacks to an endpoint of their choice. MAX includes a Global SKAdNetwork Report (MAX > Mediation > Analyze > Global SKA Report). You can use this to access the SKAdNetwork data across all of your network partners in one place.