cordova-ionic-phonegap-branch-deep-linking-attribution icon indicating copy to clipboard operation
cordova-ionic-phonegap-branch-deep-linking-attribution copied to clipboard

continueUserActivity override prevents other plugins to listen to Universal Links

Open AleCat83 opened this issue 4 years ago • 1 comments

Hello, In my Ionic (just migrate to) 5 project I need to handle both branch and regular Universal links. To do this I use Branch cordova plugin and https://github.com/ionic-team/ionic-plugin-deeplinks. Universal links were working fine until I added the Branch plugin. After some digging I think the problem is that both plugins override the continueUserActivity method, so what is happening is that Branch cordova plugin consume the universal link without it being propagated to the other plugin.

Is there a way to handle non branch Universal Links from Branch cordova plugin? If not why Branch override this method? Is it possible to simply remove the following code in AppDelegate+BranchSdk.m? `// Respond to Universal Links

  • (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { if (![[Branch getInstance] continueUserActivity:userActivity]) { // send unhandled URL to notification if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:@"BSDKPostUnhandledURL" object:[userActivity.webpageURL absoluteString]]]; } }

    return YES; }`

Commenting it out works but I am not sure if doing this results in breaking something else.

Thank you

AleCat83 avatar Sep 30 '20 00:09 AleCat83

Hey @AleCat83 please note that ionic-plugin-deeplinks is marked as incompatible with branch-deep-linking https://help.branch.io/developers-hub/docs/cordova-phonegap-ionic#compiling-incompatibilities

adrianyg7 avatar May 14 '21 23:05 adrianyg7