Menu

Import and configure

1. Overview

Flutter Version Requirement: flutter: ">=2.12.0"

TopOn iOS SDK requires version ≤ v6.4.93

You can refer to Account and Related ID Preparation for instructions on account registration and login.

3. Import Flutter SDK

Refer to the Demo Flutter Demo Github Repository (Click to Redirect)

Two methods are supported for importing the SDK:

3.1 Import from pub.dev

  1. Run the following command in the terminal: (Refer to https://pub.dev/packages/secmtp_sdk)
java Copy
flutter pub add secmtp_sdk

After running the command, the following code will be automatically added to the pubspec.yaml file of the project, and flutter pub get will be triggered. You can also manually enter the following code in pubspec.yaml:

java Copy
dependencies:
  secmtp_sdk: ^1.0.8
  1. After successful configuration, you can import the following header file for use:
plaintext Copy
import 'package:secmtp_sdk/at_init.dart';

3.2 Manual Import

  1. Download the TopOn_Flutter_SDK package and decompress it.
  2. Add the decompressed files to your project. You can also import the decompressed files into a newly created directory.
  3. Locate the pubspec.yaml file in the project and add the local dependency:
plaintext Copy
secmtp_sdk:
  path: ../
  1. Import the header file in the class:
plaintext Copy
import 'package:secmtp_sdk/at_init.dart';
  1. Run the following command in the terminal: (Refer to https://pub.dev/packages/thinkup_sdk)
java Copy
flutter pub add thinkup_sdk

After running the command, the following code will be automatically added to the pubspec.yaml file of the project, and flutter pub get will be triggered. You can also manually enter the following code in pubspec.yaml:

plaintext Copy
dependencies:
  thinkup_sdk: ^1.0.8
  1. After successful configuration, you can import the following header file for use:
plaintext Copy
import 'package:thinkup_sdk/at_init.dart';

3.2 Manual Import

  1. Download the TopOn_Flutter_SDK package and decompress it.

  2. Add the decompressed files to your project. You can also import the decompressed files into a newly created directory.

  3. Locate the pubspec.yaml file in the project and add the local dependency:

plaintext Copy
thinkup_sdk:
  path: ../
  1. Import the header file in the class:
plaintext Copy
import 'package:thinkup_sdk/at_init.dart';

4. Import iOS SDK

4.1 Prerequisites

  • The latest version of Xcode
  • CocoaPods 1.15.2 or higher installed

4.2 Locate the Correct anythink_sdk.podspec File

Note: Due to naming differences in the Flutter plugins downloaded from the SDK Download Center by different developers, anythink_sdk.podspec may also be named thinkup_sdk.podspec. Please refer to the actual plugin you downloaded.

  • If you imported the Flutter SDK from pub.dev
  1. Import the header file and hover your mouse over the imported header file:
  1. Copy the path in the red box and open it with Finder to locate the anythink_sdk.podspec file (or thinkup_sdk.podspec as mentioned in the above note).
  • If you imported the Flutter SDK manually

The target file is: the anythink_sdk.podspec file in your project directory (or thinkup_sdk.podspec as mentioned in the above note).

4.3 Obtain the iOS SDK CocoaPods Code

Please click here to go to the SDK Download Center, select the platforms to be integrated, choose "Yes" for CocoaPods integration, and then click to generate the integration code. (Take iOS 6.4.26 as an example; it is recommended to use the latest version of the iOS SDK)

4.4 Add iOS SDK Dependencies to the Correct anythink_sdk.podspec File

Convert the CocoaPods reference code generated in the previous step into the format required by the .podspec file and fill it into anythink_sdk.podspec. Example before and after conversion:

plaintext Copy
// Before conversion:
pod 'TPNiOS','x.x.xx'
pod 'TPNPangleSDKAdapter','x.x.xx'
pod 'TPNFacebookSDKAdapter','x.x.xx'
pod 'TPNAdmobSDKAdapter','x.x.xx'
pod 'TPNMintegralSDKAdapter','x.x.xx'

Only need to replace pod with s.dependency

// After conversion:
s.dependency 'TPNiOS','x.x.xx'
s.dependency 'TPNPangleSDKAdapter','x.x.xx'
s.dependency 'TPNFacebookSDKAdapter','x.x.xx'
s.dependency 'TPNAdmobSDKAdapter','x.x.xx'
s.dependency 'TPNMintegralSDKAdapter','x.x.xx'

4.5 Install the iOS SDK

After editing the anythink_sdk.podspec file, open the directory where the iOS podfile is located via terminal and wait for the installation to complete. (If it is not the first installation, you may need to delete the podfile.lock file before executing the command below)

Copy
pod install --repo-update

5. Configure the iOS Project

5.1 Update Info.plist

5.1.1 Open Info.plist

5.1.2 Add the SKAdNetworkItems Key

The SKAdNetwork ID of UnityAds varies for each project. If you select this ad platform, please refer to the ID generated in the UnityAds backend and check it in the UnityAds Admin Console.

Please go back to the "SDK Download Center" page opened above, and add the content listed in the "SKAdNetwork IDs Code" section to your Info.plist file. Refer to the figure below:

5.1.3 Add the LSApplicationQueriesSchemes Key

Please go back to the "SDK Download Center" page opened above again, or directly copy the code below, and add the content listed in the section below to your Info.plist file. Refer to the figure below:

5.1.4 Add the NSUserTrackingUsageDescription Key

Starting from iOS 14.5, apps can only access the user's IDFA data and deliver targeted ads to users with the user's explicit permission.

Before the app calls the App Tracking Transparency framework to request app tracking authorization from end users, the IDFA will be unavailable. If an app does not make this request, the read IDFA will return a string of all zeros.

plaintext Copy
<key>NSUserTrackingUsageDescription</key>
<string>Modify this to the permission request description you want users to see, which can be localized</string>

5.1.5 Add the NSAppTransportSecurity Key

After iOS 10, if the Allow Arbitrary Loads in Web Content key exists, it will override the setting of Allow Arbitrary Loads

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

5.1.6 Add the GADApplicationIdentifier Key for the AdMob Platform (Optional)

Add this key only if you have selected the AdMob platform for integration. For more information, please visit here.

plaintext Copy
<key>GADApplicationIdentifier</key>
<string>Your GADApplicationIdentifier </string>
<!-- Example value format: ca-app-pub-9488501426181082~7319780494   -->

5.2 Set -ObjC

6. Import Android SDK

6.1 Register the Plugin

Register the SDK plugin in the GeneratedPluginRegistrant class of the generated Android project:

plaintext Copy
public final class GeneratedPluginRegistrant {
  public static void registerWith(@NonNull FlutterEngine flutterEngine) {
    flutterEngine.getPlugins().add(new com.secmtp.flutter.SecmtpSdkPlugin());
  }
}

6.2 Download and Import the Android Native SDK (Version v6.5.12 or Higher Required)

  1. Please go to the official website download page, select the platforms to be integrated, and click download; after the download is complete, decompress the downloaded Android SDK package.
  2. (If the package contains a build.gradle file) Copy the content in the build.gradle file of the package to the project's build.gradle file.
  3. (If the package contains a res directory with files in it) Copy the content in the res directory of the Android SDK package to the corresponding res directory of the project.

7. Configure the Android Project

7.1 AndroidManifest Configuration

  1. Add the content in the AndroidManifest.xml file of the Android SDK package to the AndroidManifest.xml file of the project.
  2. If you have integrated AdMob, you must add the following configuration to AndroidManifest.xml (the value must be the ID of the app created in the AdMob backend):
plaintext Copy
<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, refer to the AdMob configuration document: Update your AndroidManifest.xml

7.2 Adaptation for Android 9 and Above

Please refer to: Android Integration and Initialization

7.3 SDK Obfuscation Configuration Instructions

  1. Flutter SDK Obfuscation Configuration
java Copy
-keep public class com.secmtp.flutter.**
-keepclassmembers class com.secmtp.flutter.** {
   public *;
}
java Copy
-keep public class com.thinkup.flutter.**
-keepclassmembers class com.thinkup.flutter.** {
   public *;
}
  1. Ad Platform Obfuscation Configuration for Android SDK

Please refer to the content of proguard-android.txt in the Android SDK package.

Previous
Flutter Guide
Next
Initialization instructions
Last modified: 2026-01-07Powered by