Help Center/Details/

Global configuration


-Since the brand has been upgraded from the version of the SDK, the prefix WM has been replaced with BU (Bytedance Union). If the SDK needs to be upgraded, it will be replaced in a unified manner during hard access.
-The BUAdSDKManager class is the entry and interface for the entire SDK settings. It can set some global information of the SDK and provide class methods to obtain the setting results.
-setIsPaidApp: and setUserKeywords: can be passed in only after obtaining the user's consent.
-With SDK version 3400 and above, any advertisement type does not support changing the agency midway. Changing the agency midway will result in not receiving advertisement-related callbacks. If there is a mid-way change of the agency scene, you need to handle the relevant logic yourself to ensure the normal execution of the advertisement-related callbacks.

Interface Description

The interface currently provides the following methods:

@property (nonatomic, copy, readonly, class) NSString *SDKVersion;

 Register the App key that’s already been applied before requesting an ad from TikTok Audience Network.
 @param appID: the unique identifier of the App
+ (void)setAppID:(NSString *)appID;
 Configure development mode.
 @param level: default BUAdSDKLogLevelNone
+ (void)setLoglevel:(BUAdSDKLogLevel)level;

/* Set the COPPA of the user, COPPA is the short of Children's Online Privacy Protection Rule, the interface only works in the United States.
 * @params Coppa 0 adult, 1 child
+ (void)setCoppa:(NSUInteger)Coppa;

/// Set the user's keywords, such as interests and hobbies, etc.
/// Must obtain the consent of the user before incoming.
+ (void)setUserKeywords:(NSString *)keywords;

/// set additional user information.
+ (void)setUserExtData:(NSString *)data;

/// Set whether the app is a paid app, the default is a non-paid app.
/// Must obtain the consent of the user before incoming
+ (void)setIsPaidApp:(BOOL)isPaidApp;

/// Solve the problem when your WKWebview post message empty,default is BUOfflineTypeWebview
+ (void)setOfflineType:(BUOfflineType)type;

///Fields to indicate SDK whether the user grants consent for personalized ads, the value of GDPR: 0 User has granted the consent for personalized ads, SDK will return personalized ads; 1: User doesn't grant consent for personalized ads, SDK will only return non-personalized ads.
+ (void)setGDPR:(NSInteger)GDPR;

/// Custom set the AB vid of the user. Array element type is NSNumber
+ (void)setABVidArray:(NSArray<NSNumber *> *)abvids;

/// Notice that Developers must open GDPR Privacy for the user before setAppID.
+ (void)openGDPRPrivacyFromRootViewController:(UIViewController *)rootViewController confirm:(BUConfirmGDPR)confirm;

/// get appID
+ (NSString *)appID;

/// get isPaidApp
+ (BOOL)isPaidApp;

/// get GDPR
+ (NSInteger)GDPR;

//Starting from version 3600, add SDK initialization status callback
[BUAdSDKManager startWithAsyncCompletionHandler:^(BOOL success, NSError *error) {
   if (success) {///}

Usage details

SDK needs methods in AppDelegate-
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

The seAppID setting is required:

[BUAdSDKManager setAppID:@"xxxxxx"];

For more usage methods, please refer to the SDK Demo project

Log output description

/// Whether to open log. default is none.
[BUAdSDKManager setLoglevel:BUAdSDKLogLevelDebug];

Coppa Instructions

/// Coppa 0 adult, 1 child
[BUAdSDKManager setCoppa:0];

Custom IDFA description

You can set idfa by yourself, it is optional and maybe will never be used.
[BUAdSDKManager setCustomIDFA:@"12345678-1234-1234-1234-123456789012"];

Ad skip setting

All the rootViewController's in the advertising interface are mandatory items, which are used to handle advertising jumps. All jumps in the SDK use the present method. Please ensure that the incoming rootViewController cannot be empty and no other controllers are presented, otherwise the presentedViewController will already exist and the presentation will fail.

Privacy Agreement

The coppa value can be customized to identify whether this advertisement needs to follow the children's online privacy protection regulations. GDPR can choose
+ (void)openGDPRPrivacyFromRootViewController:(UIViewController *)rootViewController confirm:(BUConfirmGDPR)confirm;
Method to pop up the selection box of whether to follow the privacy protocol. You can also customize the GDPR to identify whether this advertisement complies with the EU General Data Protection Regulations.

Custom set the GDPR of the user, GDPR is the short of General Data Protection Regulation, the interface only works in The European.
GDPR 0 close privacy protection, 1 open privacy protection
[BUAdSDKManager setGDPR:0];

Night mode

Starting from version 3600, CSJ supports developers to set the function of night mode when using templates to render information flow & interstitial & banner ads:

In the BUAdSDKManager class

  // Enumeration value type
    typedefNS_ENUM(NSInteger, BUAdSDKThemeStatus) {
      BUAdSDKThemeStatus_Normal = 0, // normal mode
      BUAdSDKThemeStatus_Night = 1, // night mode

      // If the developer does not set it, the default value is Normal, if the developer sets an illegal value, it will be forcibly changed to Normal
        + (void)setThemeStatus:(BUAdSDKThemeStatus)themeStatus;

  // Get the current topic type
      + (BUAdSDKThemeStatus)themeStatus;
Did the content solve your problem?
Contact us