Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continueUserActivity override prevents other plugins to listen to Universal Links #674

Open
AleCat83 opened this issue Sep 30, 2020 · 1 comment

Comments

@AleCat83
Copy link

AleCat83 commented Sep 30, 2020

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

@adrianyg7
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants