Menu

Integration

1. Prerequisites

You can download or update Xcode in the AppStore , or log in to the Apple Developer Resource Center to download a specific version. (Third-party download tools may not be supported).

2. Import Taku iOS SDK into the project

We provide the following two ways to import Taku iOS SDK:

  • CocoaPods (preferred)
  • Manual download and import

The easiest way to import the SDK into an iOS project is to use CocoaPods. If you are new to CocoaPods, please refer to the official CocoaPods website.

2.1 CocoaPods (preferred)

Please click here to go to the SDK Download Center. You can refer to the following picture steps to select and generate the code in the Podfile according to your needs.

Please do not leave the SDK Download Center page after generating the relevant code, as the content will be used in the subsequent docking process.

After switching to the path where the podfile is located, execute pod install --repo-update in the terminal to install it

2.2 Manual download and import

2.2.1 Manually download Taku iOS SDK

Please click here to go to the SDK Download Center. You can refer to the following sample images, select the advertising platform according to your needs and then download the Taku iOS SDK.

  • Please do not leave the SDK Download Center page after downloading the SDK, as the content will be used in the subsequent docking process.
  • After you click "Generate Access Code", the system will process your request immediately. After your patient waiting, the download link will be successfully generated and you can click the "Download" button.

2.2.2 Manually import the Taku iOS SDK

① Please unzip the ZIP file you downloaded in the previous step, and then drag it into your Xcode project.

② Modify the Xcode project Build Setting (please refer to the picture below).

③ Please return to the SDK Download Center page, check the "SDK Import Tips" column, and add the dependencies listed in the column to the Xcode project.

Depending on the type of advertising platform you have selected, the "SDK Introduction Prompt" column may appear additionally (as shown below). If the "SDK Introduction Prompt" column does not appear after you have selected the advertising platform and clicked "Generate Access Code", you can skip this step and continue with the subsequent access process.

At this point, you have completed the introduction of Taku iOS SDK, but please do not leave the "SDK Download Center" page, as the subsequent docking process will still use its content.

3. Update your Info.plist

3.1 Open Info.plist

3.2 Add SKAdNetworkItems key

The SKAdNetwork ID of UnityAds is different for each project. If you choose this advertising platform, please refer to the one generated by the UnityAds background. You need to go to the UnityAds management background to check it.

Please return to the " SDK Download Center" page opened above and add the content listed in the "SKAdNetwork IDs Code" column to your Info.plist file, as shown below:

3.3 Add LSApplicationQueriesSchemes key

Please return to the " SDK Download Center" page opened above, or directly copy the code below and add the contents listed in the following columns to your Info.plist file. Please refer to the figure below:

3.4 Add NSUserTrackingUsageDescription key

Starting from iOS14.5, applications can only access users' IDFA data and deliver targeted ads to users with the user's explicit permission.

The IDFA will not be available until the app calls the App Tracking Transparency framework to request app tracking authorization from the end user. If an app does not make this request, the IDFA read will return a string of all 0s.

markup Copy
<key>NSUserTrackingUsageDescription</key>
<string>Write Your ATT Desc</string>

3.5 Add NSAppTransportSecurity key

After iOS 10, the Allow Arbitrary Loads in Web Content key is ignored when it exists.

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

3.6 Adding the GADApplicationIdentifier key to the AdMob platform

Due to AdMob requirements, this key is only added if you check the box to use the platform. For more information, go here .

markup Copy
<key>GADApplicationIdentifier</key>
<string>Your GADApplicationIdentifier </string>
<!-- format eg:ca-app-pub-9488501426181082~7319780494   -->

4. Request app tracking permission from users to obtain IDFA

You need to apply for app tracking permissions from users through App Tracking Transparency.

  • Before you use the following method, you need to set the NSUserTrackingUsageDescription key in your Info.plist file. Click here for details.
  • If you need to adapt GDPR or Google UMP in your project, please go here to configure it without adding the following code.
objc Copy
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
#import <AnyThinkSDK/AnyThinkSDK.h>

@implementation AppDelegate
 
- (void)applicationDidBecomeActive:(UIApplication *)application {
    if (@available(iOS 14, *)) {
        //iOS 14
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {

        }];
    } else {
        NSString * idfaStr = [ASIdentifierManager sharedManager].advertisingIdentifier.UUIDString;
    }
}

@end

In iOS 15 and above, calling this API will prompt for authorization only when the application state is UIApplicationStateActive. If another permission request is waiting for user confirmation, the authorization prompt will not be displayed. Therefore, you can choose one of the following options as a backup solution:

  • After launching the app, wait 1 to 2 seconds to check and apply for permissions.
  • Check and apply for permissions in the main controller's ViewDidAppear method.

5. Enable debug logging

objc Copy
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    //....
    //SDK log switch
    [ATAPI setLogEnabled:YES];//Turn on debug logs
    //....
     
    return YES;
}

6. SDK integration verification

You can check whether the SDK integration of each advertising platform is normal based on the log output by this method.

Please note that this feature needs to be removed before the package can be put on the shelves.

objc Copy
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    //....
    //Open SDK logs
    [ATAPI setLogEnabled:YES];//Turn on debug logs

    //After logs open
    [ATAPI integrationChecking];

    return YES;
}

Sample output:

7. Initialize the SDK

⚠️ Important (Required for Compliance)

The initialization method must be called in a way that satisfies all three of the following conditions:

  1. Call it only after the user has consented to the privacy policy. If your app displays a privacy policy and requests user consent on first launch, see the Taku Privacy Policy and Privacy Compliance.
  2. Do not call it prematurely during app launch. It must not be placed on startup paths such as application:didFinishLaunchingWithOptions: or viewDidLoad.
  3. Treat it as a prerequisite for ad loading (load). Within the same call chain, complete initialization first and then perform the load. If initialization does not succeed, do not proceed with loading ads.

💡 Tips

  • Safe to call repeatedly: Initialization is idempotent — once the SDK is initialized, subsequent calls return success immediately. It is therefore safe to place initialization before every ad load, and there is no need to maintain your own "initialize only once" flag.
  • AppID / AppKey: Obtain these from the app details in the Taku dashboard. The iOS and Android values are not interchangeable — do not mix them up.
  • Logging switch: setLogEnabled: outputs the IDFA and device information and is intended for integration debugging only. Wrap it in #if DEBUG; never ship it in a Release build.

7.1 Sample Code

objc Copy
#import <AnyThinkSDK/AnyThinkSDK.h>

@interface AdManager : NSObject

- (BOOL)configureAdSDK;
- (void)loadAd;

@end

@implementation AdManager

/// Initializes the ad SDK.
/// Idempotent: once the SDK is initialized, repeated calls return success immediately,
/// so it is safe to call this before every ad load.
/// @return Whether initialization succeeded. If NO is returned, do not proceed with loading ads.
- (BOOL)configureAdSDK {
#if DEBUG
    // Outputs the IDFA and device information; for debugging only — never ship in a Release build
    [ATAPI setLogEnabled:YES];
#endif

    NSError *error = nil;
    BOOL success = [[ATAPI sharedInstance] startWithAppID:@"Your AppID"
                                                  appKey:@"Your AppKey"
                                                   error:&error];

    if (!success) {
        NSLog(@"[TaKu] SDK initialization failed domain=%@ code=%ld msg=%@",
              error.domain,
              (long)error.code,
              error.userInfo[@"msg"]);
    }
    return success;
}

/// Loads an ad.
/// Precondition: the user has consented to the privacy policy.
- (void)loadAd {
    // Initialization is a prerequisite for load: initialize first, then load only after it succeeds
    if (![self configureAdSDK]) {
        return;
    }

#if DEBUG
    // Self-check for third-party platform integrations; for debugging only,
    // not a required part of initialization
    [ATAPI integrationChecking];
#endif

    // Once initialization succeeds, proceed with the ad load
    // [self.bannerView loadAd:@"Your PlacementID"];
}

@end
Last modified: 2026-09-14Powered by