@@ -256,6 +256,20 @@ - (id)initWithInterface:(BNCServerInterface *)interface
256
256
if (config.checkPasteboardOnInstall ) {
257
257
[self checkPasteboardOnInstall ];
258
258
}
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
+ }
259
273
260
274
return self;
261
275
}
@@ -455,6 +469,15 @@ + (void)enableLoggingAtLevel:(BranchLogLevel)logLevel withCallback:(nullable Bra
455
469
}
456
470
}
457
471
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
+
458
481
- (void )useEUEndpoints {
459
482
[BNCServerAPI sharedInstance ].useEUServers = YES ;
460
483
}
@@ -632,7 +655,7 @@ - (void)initSessionWithLaunchOptions:(NSDictionary *)options automaticallyDispla
632
655
633
656
#pragma mark - Actual Init Session
634
657
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 {
636
659
[self initSceneSessionWithLaunchOptions: options isReferrable: isReferrable explicitlyRequestedReferrable: explicitlyRequestedReferrable automaticallyDisplayController: automaticallyDisplayController
637
660
registerDeepLinkHandler: ^(BNCInitSessionResponse * _Nullable initResponse, NSError * _Nullable error) {
638
661
if (callback) {
@@ -1107,8 +1130,8 @@ - (NSDictionary *)getFirstReferringParams {
1107
1130
1108
1131
if (self.deepLinkDebugParams ) {
1109
1132
NSMutableDictionary * debugInstallParams =
1110
- [[BNCEncodingUtils decodeJsonStringToDictionary: self .preferenceHelper.sessionParams]
1111
- mutableCopy ];
1133
+ [[BNCEncodingUtils decodeJsonStringToDictionary: self .preferenceHelper.sessionParams]
1134
+ mutableCopy ];
1112
1135
[debugInstallParams addEntriesFromDictionary: self .deepLinkDebugParams];
1113
1136
return debugInstallParams;
1114
1137
}
@@ -2051,7 +2074,7 @@ - (void)initUserSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSStr
2051
2074
// only called from initUserSessionAndCallCallback!
2052
2075
- (void )initializeSessionAndCallCallback : (BOOL )callCallback sceneIdentifier : (NSString *)sceneIdentifier urlString : (NSString *)urlString {
2053
2076
2054
- // BranchDelegate willStartSessionWithURL notification
2077
+ // BranchDelegate willStartSessionWithURL notification
2055
2078
NSURL *URL = (self.preferenceHelper .referringURL .length ) ? [NSURL URLWithString: self .preferenceHelper.referringURL] : nil ;
2056
2079
if ([self .delegate respondsToSelector: @selector (branch:willStartSessionWithURL: )]) {
2057
2080
[self .delegate branch: self willStartSessionWithURL: URL];
@@ -2116,7 +2139,7 @@ - (void)initializeSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSS
2116
2139
2117
2140
[self processNextQueueItem ];
2118
2141
});
2119
- }
2142
+ }
2120
2143
}
2121
2144
2122
2145
0 commit comments