@@ -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 *whiteListedSchemes;
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+ _whiteListedSchemes = [[NSMutableArray alloc ] init ];
150152 _useCookieBasedMatching = YES ;
151153
152154 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter ];
@@ -320,12 +322,28 @@ - (void) setDeepLinkDebugMode:(NSDictionary *)debugParams {
320322 self.deepLinkDebugParams = debugParams;
321323}
322324
325+ -(void )setWhiteListedSchemes : (NSArray *)schemes {
326+ self.whiteListedSchemes = [schemes mutableCopy ];
327+ }
328+
329+ -(void )addWhiteListedScheme : (NSString *)scheme {
330+ [self .whiteListedSchemes 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 .whiteListedSchemes count ]) {
339+ for (NSString *scheme in self.whiteListedSchemes ) {
340+ if ([scheme isEqualToString: [url scheme ]]) {
341+ self.preferenceHelper .externalIntentURI = [url absoluteString ];
342+ }
343+ }
344+ } else {
345+ self.preferenceHelper .externalIntentURI = [url absoluteString ];
346+ }
329347
330348 NSString *query = [url fragment ];
331349 if (!query) {
0 commit comments