@@ -80,6 +80,7 @@ @interface Branch() <BranchDeepLinkingControllerCompletionDelegate, FABKit>
8080@property (strong , nonatomic ) NSDictionary *deepLinkDebugParams;
8181@property (assign , nonatomic ) BOOL accountForFacebookSDK;
8282@property (assign , nonatomic ) id FBSDKAppLinkUtility;
83+ @property (strong , nonatomic ) NSMutableArray *whiteListedSchemeList;
8384
8485@end
8586
@@ -147,6 +148,7 @@ - (id)initWithInterface:(BNCServerInterface *)interface queue:(BNCServerRequestQ
147148 _processing_sema = dispatch_semaphore_create (1 );
148149 _networkCount = 0 ;
149150 _deepLinkControllers = [[NSMutableDictionary alloc ] init ];
151+ _whiteListedSchemeList = [[NSMutableArray alloc ] init ];
150152 _useCookieBasedMatching = YES ;
151153
152154 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter ];
@@ -320,12 +322,29 @@ - (void) setDeepLinkDebugMode:(NSDictionary *)debugParams {
320322 self.deepLinkDebugParams = debugParams;
321323}
322324
325+ -(void )setWhiteListedSchemes : (NSArray *)schemes {
326+ self.whiteListedSchemeList = [schemes mutableCopy ];
327+ }
328+
329+ -(void )addWhiteListedScheme : (NSString *)scheme {
330+ [self .whiteListedSchemeList addObject: scheme];
331+ }
323332
324333- (BOOL )handleDeepLink : (NSURL *)url {
325334 BOOL handled = NO ;
326335 if (url && ![url isEqual: [NSNull null ]]) {
327- // always save the incoming url in the preferenceHelper in the externalIntentURI field
328- self.preferenceHelper .externalIntentURI = [url absoluteString ];
336+
337+ // save the incoming url in the preferenceHelper in the externalIntentURI field
338+ if ([self .whiteListedSchemeList count ]) {
339+ for (NSString *scheme in self.whiteListedSchemeList ) {
340+ if ([scheme isEqualToString: [url scheme ]]) {
341+ self.preferenceHelper .externalIntentURI = [url absoluteString ];
342+ break ;
343+ }
344+ }
345+ } else {
346+ self.preferenceHelper .externalIntentURI = [url absoluteString ];
347+ }
329348
330349 NSString *query = [url fragment ];
331350 if (!query) {
0 commit comments