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

Problem with external deep links on iOS #378

Closed
ksteuer opened this issue Oct 4, 2017 · 5 comments
Closed

Problem with external deep links on iOS #378

ksteuer opened this issue Oct 4, 2017 · 5 comments

Comments

@ksteuer
Copy link

ksteuer commented Oct 4, 2017

Hello, everyone!

I am not able to login with LinkedIn after integration with Branch.io. I've found that the problem is caused by intercepting LinkedIn deep link by Branch (LinkedIn SDK is creating its own URI-Scheme for the app. Is there any solution to "bypass" links which are not defined in Branch configuration?

Thanks!
Kamil

@ethanneff
Copy link
Contributor

Thank you for reaching out. I am not familiar with the Linkedin SDK, so, unfortunately, it was not part of our test plans. Can you please provide me steps to reproduce the issue as well as the plugins you are using? There is a chance their SDK is clashing with the configs of our SDK.

Thanks,

@ksteuer
Copy link
Author

ksteuer commented Oct 10, 2017

Hi. Thanks for showing your interest. I use cordova-plugin-linkedin and it works pretty well until I install cordova-ionic-phonegap-branch-deep-linking. After that, I cannot authorize with LinkedIn because deep link which is needed to return to the app is caught by branch plugin, so my app doesn't receive the token. LinkedIn is creating its own URI-Scheme ("li://") so in my opinion, it shouldn't be caught by branch.

@ethanneff
Copy link
Contributor

Hello again,

This is the intended behavior of the Branch SDK. Both Branch and non-Branch deep links are parsed through our SDK (code). However, the URI Scheme will only be attributed to Branch if it is related to Branch.

If you want to isolate the Linkedin SDK and the Branch SDK, you can add logic within the branch.initSession() to ignore +clicked_branch_link=false.

Thanks,

@ksteuer
Copy link
Author

ksteuer commented Oct 17, 2017

Hello,

I do not agree with you because I don't get this link in my app. I've found the reason in branch.js file. This occurs when another deep link (in my case linkedin deep link) is called before Branch deep link (as a first deep link after branch initialization) or two non-branch links one after another. PreviousLinkTimestap initially is set to null and LinkedIn deep link does not contain its own timestamp property, so currentLinkTimestamp has also null value. As a result, callback is not called. I enclosed the code below:
if ((isBranchLinkClick || isNonBranchLinkClick) && currentLinkTimestamp !== previousLinkTimestamp) { deepLinkDataListener(deepLinkData) }

@ethanneff
Copy link
Contributor

ethanneff commented Oct 17, 2017

Hello again,

I revisited this issue, and have made the following changes to the branch.js logic (f3748a2#diff-c272cc6c1de9a9807c8642f663f15d47L53). With these changes, I was able to get the LinkedIn URL scheme as a +non_branch_link within the branch.initSession().
img_0465

I would recommend updating to the latest version 2.6.15. You can use this guide to update your Cordova Branch SDK.

As for the Cordova Linkedin SDK, I have a feeling they are missing a method in their iOS openURL() which will allow deep linking from multiple SDKs (https://github.com/zyra/cordova-plugin-linkedin/issues/31). This could be the root cause why their SDK is not firing.

Thanks,

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