Help Center/Details/

Initialize Pangle SDK

Pass AppID to initialize Pangle SDK

You must initialize Pangle SDK before loading Pangle ads. This needs to be done only once, ideally at App Launch stage(in AppDelegate method).

Pangle provides a new asynchronize sdk initialization method starting from v3.6.0.0,, in the new initialization flow, there is a BUAdSDKConfiguration class, any setups should be passed through BUAdSDKConfiguration class. When Pangle SDK is initialized successfully, you will get the notification from the init callback.
We recommand to set allowModifyAudioSessionSetting to true to not interrupt the background's audio playback.

  • the old initialization method setAppID still works in the new sdk.
BUAdSDKConfiguration *configuration = [BUAdSDKConfiguration configuration];
configuration.territory = BUAdSDKTerritory_NO_CN;
//Set to true to NOT interrupt background app's audio playback
configuration.allowModifyAudioSessionSetting = true;
configuration.coppa = @(0);
configuration.logLevel = BUAdSDKLogLevelDebug;
configuration.appID = @"Your App Id";
[BUAdSDKManager startWithAsyncCompletionHandler:^(BOOL success, NSError *error) {
    if (success) {
       //Pangle SDK has been successfully initialized


Warning: Ads may be preloaded by the Pangle Ads SDK or mediation partner SDKs after initialization. If you need to obtain consent from users under age 13, please ensure you do so before initializing the Pangle Ads SDK.

Interface Instruction

Currently, the BUAdSDKManager provides the following class methods.

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

/// The PangleSDK initialization state
@property (nonatomic, assign, readonly, class) BUAdSDKInitializationState initializationState;

/// The synchronize initialization method of Pangle
/// @param completionHandler Callback to the initialization state of the calling thread
+ (void)startWithSyncCompletionHandler:(BUCompletionHandler)completionHandler;

/// The asynchronize initialization method of Pangle
/// @param completionHandler Callback to the initialization state of the non-main thread
+ (void)startWithAsyncCompletionHandler:(BUCompletionHandler)completionHandler;

/// Open GDPR Privacy for the user to choose before setAppID.
+ (void)openGDPRPrivacyFromRootViewController:(UIViewController *)rootViewController confirm:(BUConfirmGDPR)confirm;

/// Register the App key that’s already been applied before requesting an ad from Pangle Plarform.                                                       @param appID : the unique identifier of the App
+ (void)setAppID:(NSString *)appID;

///This property should be set when integrating non-China areas at the same time, otherwise it does not need to be‘d better set Territory first,  if you need to set them.                                                      @param territory : Regional value: 1.BUAdSDKTerritory_CN  2.BUAdSDKTerritory_NO_CN
+ (void)setTerritory:(BUAdSDKTerritory)territory;

 ///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;

 Whether to allow SDK to modify the category and options of AVAudioSession when playing audio, default is NO.
 The category set by the SDK is AVAudioSessionCategoryAmbient, and the options are AVAudioSessionCategoryOptionDuckOthers
+ (void)allowModifyAudioSessionSetting:(BOOL)isAllow;

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

See SDK Demo Project or GitHub for more details.


Pangle also compliances with Children’s Online Privacy Protection Act (COPPA), Pangle SDK provides setCoppa method for publishers. At the moment, Pangle won't return ads for Children (Under the age of 13).

Redirect Readme

All the rootViewController parameters in Ad APIs must be provided to process ad redirects. In the SDK, all redirects use the present method. Therefore, make sure that the passed rootViewController parameters are not null and do not have other present controllers. Otherwise the present will fail because presentedViewController already exists.

Did the content solve your problem?