@@ -256,6 +256,20 @@ - (id)initWithInterface:(BNCServerInterface *)interface
256256 if (config.checkPasteboardOnInstall ) {
257257 [self checkPasteboardOnInstall ];
258258 }
259+
260+ if (config.cppLevel ) {
261+ if ([config.cppLevel caseInsensitiveCompare: @" FULL" ] == NSOrderedSame) {
262+ [[Branch getInstance ] setConsumerProtectionAttributionLevel: BranchAttributionLevelFull];
263+ } else if ([config.cppLevel caseInsensitiveCompare: @" REDUCED" ] == NSOrderedSame) {
264+ [[Branch getInstance ] setConsumerProtectionAttributionLevel: BranchAttributionLevelReduced];
265+ } else if ([config.cppLevel caseInsensitiveCompare: @" MINIMAL" ] == NSOrderedSame) {
266+ [[Branch getInstance ] setConsumerProtectionAttributionLevel: BranchAttributionLevelMinimal];
267+ } else if ([config.cppLevel caseInsensitiveCompare: @" NONE" ] == NSOrderedSame) {
268+ [[Branch getInstance ] setConsumerProtectionAttributionLevel: BranchAttributionLevelNone];
269+ } else {
270+ NSLog (@" Invalid CPP Level set in branch.json: %@ " , config.cppLevel );
271+ }
272+ }
259273
260274 return self;
261275}
@@ -455,6 +469,15 @@ + (void)enableLoggingAtLevel:(BranchLogLevel)logLevel withCallback:(nullable Bra
455469 }
456470}
457471
472+ + (void )enableLoggingAtLevel : (BranchLogLevel)logLevel withAdvancedCallback : (nullable BranchAdvancedLogCallback)callback {
473+ BranchLogger *logger = [BranchLogger shared ];
474+ logger.loggingEnabled = YES ;
475+ logger.logLevelThreshold = logLevel;
476+ if (callback) {
477+ logger.advancedLogCallback = callback;
478+ }
479+ }
480+
458481- (void )useEUEndpoints {
459482 [BNCServerAPI sharedInstance ].useEUServers = YES ;
460483}
@@ -632,7 +655,7 @@ - (void)initSessionWithLaunchOptions:(NSDictionary *)options automaticallyDispla
632655
633656#pragma mark - Actual Init Session
634657
635- - (void )initSessionWithLaunchOptions : (NSDictionary *)options isReferrable : (BOOL )isReferrable explicitlyRequestedReferrable : (BOOL )explicitlyRequestedReferrable automaticallyDisplayController : (BOOL )automaticallyDisplayController registerDeepLinkHandlerUsingBranchUniversalObject : (callbackWithBranchUniversalObject)callback {
658+ - (void )initSessionWithLaunchOptions : (NSDictionary *)options isReferrable : (BOOL )isReferrable explicitlyRequestedReferrable : (BOOL )explicitlyRequestedReferrable automaticallyDisplayController : (BOOL )automaticallyDisplayController registerDeepLinkHandlerUsingBranchUniversalObject : (callbackWithBranchUniversalObject)callback {
636659 [self initSceneSessionWithLaunchOptions: options isReferrable: isReferrable explicitlyRequestedReferrable: explicitlyRequestedReferrable automaticallyDisplayController: automaticallyDisplayController
637660 registerDeepLinkHandler: ^(BNCInitSessionResponse * _Nullable initResponse, NSError * _Nullable error) {
638661 if (callback) {
@@ -1107,8 +1130,8 @@ - (NSDictionary *)getFirstReferringParams {
11071130
11081131 if (self.deepLinkDebugParams ) {
11091132 NSMutableDictionary * debugInstallParams =
1110- [[BNCEncodingUtils decodeJsonStringToDictionary: self .preferenceHelper.sessionParams]
1111- mutableCopy ];
1133+ [[BNCEncodingUtils decodeJsonStringToDictionary: self .preferenceHelper.sessionParams]
1134+ mutableCopy ];
11121135 [debugInstallParams addEntriesFromDictionary: self .deepLinkDebugParams];
11131136 return debugInstallParams;
11141137 }
@@ -2051,7 +2074,7 @@ - (void)initUserSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSStr
20512074// only called from initUserSessionAndCallCallback!
20522075- (void )initializeSessionAndCallCallback : (BOOL )callCallback sceneIdentifier : (NSString *)sceneIdentifier urlString : (NSString *)urlString {
20532076
2054- // BranchDelegate willStartSessionWithURL notification
2077+ // BranchDelegate willStartSessionWithURL notification
20552078 NSURL *URL = (self.preferenceHelper .referringURL .length ) ? [NSURL URLWithString: self .preferenceHelper.referringURL] : nil ;
20562079 if ([self .delegate respondsToSelector: @selector (branch:willStartSessionWithURL: )]) {
20572080 [self .delegate branch: self willStartSessionWithURL: URL];
@@ -2116,7 +2139,7 @@ - (void)initializeSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSS
21162139
21172140 [self processNextQueueItem ];
21182141 });
2119- }
2142+ }
21202143}
21212144
21222145
0 commit comments