Flutter version requirement: flutter: ">=2.12.0"
iOS SDK version requirements:
| Flutter SDK Version | iOS SDK Version |
|---|---|
| <= 1.0.8 | 6.4.93 |
| >=1.0.9 | 6.5.34、6.5.43 |
You can follow the Account and Related ID Preparation guide for account registration and login instructions.
See the Demo Flutter Demo Github (click to jump)
Two methods for importing the SDK are supported:
1. Run the following command in the terminal command line: (Refer to https://pub.dev/packages/anythink_sdk )
flutter pub add anythink_sdk
After running the command, the following code will be automatically added to the project's pubspec.yaml and trigger flutter pub get. You can also manually add the following code in pubspec.yaml:
dependencies:
anythink_sdk: ^x.x.x
2. After successful, you can import the following header file and use it:
import 'package:anythink_sdk/at_index.dart';
Download the AnyThink_Flutter_SDK compressed package and decompress it.
Add the decompressed files to your project. You can also import the decompressed files into a newly created directory.
Locate pubspec.yaml in the project and add the local dependency:
anythink_sdk:
path: ../
import 'package:anythink_sdk/at_index.dart';

The target file is the anythink_sdk.podspec file in your project directory.
Please click here to go to the SDK Download Center, select the platforms you need to integrate, choose "Yes" for CocoaPods integration, and click Generate Integration Code. (Using iOS 6.4.87 as an example, it is recommended to use the latest version of the iOS SDK.)

Convert the CocoaPods reference code generated in the previous step into the code required by the .podspec file, then fill it into anythink_sdk.podspec. The conversion before and after is as follows:
// Before conversion:
pod 'AnyThinkiOS','x.x.xx'
pod 'AnyThinkBaiduSDKAdapter','x.x.xx'
pod 'AnyThinkKuaiShouSDKAdapter',''x.x.xx'
pod 'AnyThinkTTSDKAdapter','x.x.xx'
pod 'AnyThinkGDTSDKAdapter','x.x.xx'
Simply replace pod with s.dependency
// After conversion:
s.dependency 'AnyThinkiOS','x.x.xx'
s.dependency 'AnyThinkBaiduSDKAdapter','x.x.xx'
s.dependency 'AnyThinkKuaiShouSDKAdapter','x.x.xx'
s.dependency 'AnyThinkTTSDKAdapter','x.x.xx'
s.dependency 'AnyThinkGDTSDKAdapter','x.x.xx'
After writing anythink_sdk.podspec, use the terminal to open the iOS podfile directory and wait for the installation to complete. (If this is not the first time, you may need to delete podfile.lock before executing the command below.)
pod install --repo-update


Please return to the "SDK Download Center" webpage opened above, and add the content listed in the "SKAdNetwork IDs Code" section to your Info.plist file. Refer to the image below:

Please return again to the "SDK Download Center" webpage opened above, or directly copy the code below, and add the content listed in the following section to your Info.plist file. Refer to the image below:

Starting from iOS 14.5, apps can access the user's IDFA data and serve targeted ads to users only after obtaining the user's explicit permission.
Before the app calls the App Tracking Transparency framework to make an app tracking authorization request to the end user, IDFA will be unavailable. If an app does not make this request, the read IDFA will return a string of all zeros.
<key>NSUserTrackingUsageDescription</key>
<string>Modify this to the permission request description you want users to see, can be localized</string>
After iOS 10, when the Allow Arbitrary Loads in Web Content key exists, it ignores the Allow Arbitrary Loads setting.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true></true>
</dict>
Only add this key if you have selected and are using the Admob platform. For more information, go here.
<key>GADApplicationIdentifier</key>
<string>Your GADApplicationIdentifier </string>
<!-- Example format of the above value: ca-app-pub-9488501426181082~7319780494 -->

Register the SDK plugin in the GeneratedPluginRegistrant class of the generated Android project:
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
flutterEngine.getPlugins().add(new com.anythink.flutter.AnythinkSdkPlugin());
}
}
1. Go to the Official Website Download Page, select the platforms you need to integrate, and click download. After downloading, decompress the resulting Android SDK compressed package.
dependencies {
api fileTree(dir: '<plugins>/android/libs', include: ['*.aar', '*.jar'])
}</plugins>
Note: Replace with the actual path where the anythink_sdk folder is placed in the project.
(If there is a build.gradle file in the compressed package) Copy the content from the compressed package's build.gradle into the project's build.gradle.
(If there is a res directory in the compressed package and there are files in the res directory) Copy the content from the res directory in the Android SDK compressed package correspondingly into the project's res directory.
1. Add the content from the AndroidManifest.xml in the Android SDK compressed package to the AndroidManifest.xml in the project.
2. If Admob is integrated, the following configuration must be added to AndroidManifest.xml (the value should be configured with the ID of the app created in the Admob dashboard):
<manifest>
<application>
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"></meta-data>
</application>
</manifest>
For details, see the Admob configuration documentation: Update your AndroidManifest.xml
Please refer to: Android Integration and Initialization
1. Flutter SDK obfuscation configuration
-keep public class com.anythink.flutter.**
-keepclassmembers class com.anythink.flutter.** {
public *;
}
2. Android SDK ad platform obfuscation configuration
Please refer to the proguard-android.txt content in the Android SDK compressed package.