@@ -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}
@@ -641,7 +655,7 @@ - (void)initSessionWithLaunchOptions:(NSDictionary *)options automaticallyDispla
641655
642656#pragma mark - Actual Init Session
643657
644- - (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 {
645659 [self initSceneSessionWithLaunchOptions: options isReferrable: isReferrable explicitlyRequestedReferrable: explicitlyRequestedReferrable automaticallyDisplayController: automaticallyDisplayController
646660 registerDeepLinkHandler: ^(BNCInitSessionResponse * _Nullable initResponse, NSError * _Nullable error) {
647661 if (callback) {
@@ -1116,8 +1130,8 @@ - (NSDictionary *)getFirstReferringParams {
11161130
11171131 if (self.deepLinkDebugParams ) {
11181132 NSMutableDictionary * debugInstallParams =
1119- [[BNCEncodingUtils decodeJsonStringToDictionary: self .preferenceHelper.sessionParams]
1120- mutableCopy ];
1133+ [[BNCEncodingUtils decodeJsonStringToDictionary: self .preferenceHelper.sessionParams]
1134+ mutableCopy ];
11211135 [debugInstallParams addEntriesFromDictionary: self .deepLinkDebugParams];
11221136 return debugInstallParams;
11231137 }
@@ -2060,7 +2074,7 @@ - (void)initUserSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSStr
20602074// only called from initUserSessionAndCallCallback!
20612075- (void )initializeSessionAndCallCallback : (BOOL )callCallback sceneIdentifier : (NSString *)sceneIdentifier urlString : (NSString *)urlString {
20622076
2063- // BranchDelegate willStartSessionWithURL notification
2077+ // BranchDelegate willStartSessionWithURL notification
20642078 NSURL *URL = (self.preferenceHelper .referringURL .length ) ? [NSURL URLWithString: self .preferenceHelper.referringURL] : nil ;
20652079 if ([self .delegate respondsToSelector: @selector (branch:willStartSessionWithURL: )]) {
20662080 [self .delegate branch: self willStartSessionWithURL: URL];
@@ -2125,7 +2139,7 @@ - (void)initializeSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSS
21252139
21262140 [self processNextQueueItem ];
21272141 });
2128- }
2142+ }
21292143}
21302144
21312145
0 commit comments