When Using Facebook Deep Url To Open App, Both App And Webpage Open Together
Solution 1:
This is most likely the expected behavior for that code.
What you're doing when that button is clicked is immediately opening the URL fb://profile/1456471431314551
. Assuming this is iOS, this causes the system to show an alert asking if you want the app to launch. However, as of iOS 9.2, this alert is non-blocking, which means other code continues to execute in the background. This is why, 25 milliseconds later, you're opening the URL https://www.facebook.com/angelsatwork2015
as a regular webpage.
Unfortunately there is no good solution to this in the iOS 9.2+ world (thanks, Apple...). What we do at Branch.io is a combination of Universal Links (which launch the app when it is installed...most of the time) and redirections like the one you're trying for edge cases where Universal Links don't work. We set tracking cookies based on device UUID to know when we are safe to attempt launching the app, but in reality, this often means we have to redirect to the App Store if we aren't sure, just to avoid the behavior you're encountering.
Post a Comment for "When Using Facebook Deep Url To Open App, Both App And Webpage Open Together"