9

Deeplinks working perfectly when using chrome iOS app. But in safari it stopped working and it always redirect to the appstore page even the app is installed or sometimes pop a alert saying "safari cannot open the page because the address is invalid". Everything works perfect few days back. so my guess is this happens after the ios 9.2 update. Any solution for this?

UPDATE

I have tried using a new phone(Which app not installed before) and installed the app.

Deep links works for both browsers (Safari and Chrome).

If you push the bnc.lt forward button it opens App Store for both Safari and Chrome.

Next time you open a link deep link:

  • Safari: It asks if you want to open the link in app store
  • Chrome: It asks if you want to open app and at the same time redirects to app store. If you click open in app next time you click a deep link it will open in app.

So in other words you can still open the app from Chrome after clicking the bnc.lt forward link in staus bar. This is because Chrome asks for opening the app and not app store.

For Safari i end up in an irreversible state where the deep link always open app store and not the app.

Rocky Perera
  • 814
  • 1
  • 10
  • 20
  • This is because the introduction of universal links in iOS 9, which are intended to replace app URI schemes. There is a blog post by Branch.io explaining the same and also how to implement universal links in your app. https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9 – ZeMoon Mar 04 '16 at 05:56

2 Answers2

14

Alex from Branch here: this is the expected behavior. Unfortunately our fallback options are rather limited at the moment, due to the changes to Universal Links in iOS 9.2.

TL;DR: it's a bit of an edge case that most users wouldn't encounter, but you can easily work around it by making use of our Deepviews functionality.

Basically, here's the logic behind what you're seeing:

  1. When you open the link on a device without the app installed, you end up on our bnc.lt server, and we redirect you to the App Store so you can get the app. This is good.
  2. When you open the link on a device with the app installed for the first time, your device detects the Universal Link and opens the app immediately. All this happens locally on your device, and you never even get to our bnc.lt server. This is also good.
  3. When you push the bnc.lt forward button, you're telling your device 'I don't want you to immediately open the app...show me the web content for this link instead'. In the case of a Branch link, this 'web content' is simply a redirect to the App Store. At this point, Branch has no way to know whether you the app is installed or not, so we have to assume it isn't and you get the same treatment as 1. above. This is not so good, but right now we don't have any better options due to the way Apple has designed the system.
  4. The next time you open a link, your device remembers that you pushed the bnc.lt button in the past and just takes you straight to the web content. I'm not sure why Safari does it this way, because I can't imagine many situations where this would be desirable and it is leading to a lot of confusion for users.

The real problem here is that when you press bnc.lt to bypass the app, your device remembers this preference and executes it every time it sees a bnc.lt link in future. Chrome still 'works' because it is proactively confirming the preference each time in 4., whereas Safari just plows forward. There are a few options for what happens next:

  • In Apple's ideal world, you'd end up on a normal webpage where you could simply scroll up and use the Open in app button to reverse this preference. But since Branch is immediately redirecting you to the App Store, this isn't an option. You could consider using our Deepviews feature, since this does provide some real web content in place of the immediate App Store redirect you're seeing right now.
  • In most situations, you can still long-press on the link and select Open in app, but this doesn't help users who don't know the option is there.
  • In the worst-case scenario, you end up on the App Store page and just press the Open button (instead of Install). Thanks to Branch's magic, you'll still end up in the right place!
Alex Bauer
  • 11,741
  • 1
  • 18
  • 35
  • 6
    great explanation, but these words `In Apple's ideal world` make my day :P – Vineet Choudhary Mar 04 '16 at 18:47
  • Thanks for the explanation. We hope that we will get a good fix for this in future. – Rocky Perera Mar 07 '16 at 07:28
  • @AlexBauer I am facing the same issue and I did not even push the bnc.It forward button but it always redirect to the appstore page even the app is installed or sometimes pop a alert saying "safari cannot open the page because the address is invalid". How am i supposed to make it work ? – Hazim May 18 '16 at 21:24
  • It's working on ios8 and only on chrome on ios9 and not safari for me too – Hazim May 18 '16 at 21:39
  • @Hazim these sound like the symptoms of an app where Universal Links aren't totally configured yet. We have a [troubleshooting page](https://dev.branch.io/getting-started/universal-app-links/support/ios/#troubleshooting-universal-links) in our docs that might help, or feel free to post a new question with the branch.io tag and I'll jump right in! – Alex Bauer May 19 '16 at 15:56
  • @Hazim I have the exact same problem, how did you resolve it? – httpete Sep 14 '16 at 14:20
  • @httpete did you have a chance to run through the troubleshooting guide listed above? – Alex Bauer Sep 14 '16 at 16:41
  • Has anything changed with iOS 10 or this is still an unsolvable problem? – Lord Zsolt Oct 25 '16 at 12:43
  • @LordZsolt unfortunately no changes with iOS 10. Yeah, I'm surprised too... – Alex Bauer Oct 25 '16 at 12:54
1

Now from iOS 9.2, Apple no longer supports URI schemes for deep linking, developers must implement Universal Links in order to deep link properly on iOS.

Universal links let you replace custom URL schemes with standard HTTP or HTTPS links. Universal links work for all users: If users have your app installed, the link takes them directly into your app; if they don’t have your app installed, the link opens your website in Safari.

To learn all about universal links, see

How to support Universal Links in iOS App and setup server for it?

Example

https://github.com/vineetchoudhary/iOS-Universal-Links


UPDATE [1]

How Branch links work (Branch.io)

If you take a lock at fundamentals of Branch's contextual deep links. You found Branch.io also using traditional deep-linking

1. Creating links When you’ve integrated the Mobile SDK, you can create a Branch link every time a user clicks to share or invite another user from within your app. Your app makes a call to Branch.io, and Branch.io return a Branch link.

2. Tying data to links

3. Clicking links enter image description here

4. Using data


Check the Clicking links step, Branch.io just map your website URL with your app URI scheme but URI schemeno longer supported by Safari. So, move to Universal Links is only the option in order to deep linking in iOS 9.2 or you can wait for some solution by Branch.io. Thanks.

Community
  • 1
  • 1
Vineet Choudhary
  • 6,891
  • 3
  • 43
  • 70
  • im using branch.io to deeplinking. Im not using native way. Problem occurs only in safari after clicking the forward arrow in the status bar. – Rocky Perera Mar 04 '16 at 07:03
  • @RockyPerera please check update section of my answer – Vineet Choudhary Mar 04 '16 at 07:47
  • Thanks for you explanation. Im using branch because i want user to redirect to the clicked page in app even the user downloaded it from appstore for first time. Which is not given by the native at the moment. I have updated the question. Please see if you can give a comment on it. – Rocky Perera Mar 04 '16 at 08:11
  • 1
    This is an accurate overview of the Branch's pre-Universal Link redirection. Thanks, @VineetChoudhary! Source for this graphic, and additional details [here](https://branch.io/how-branch-links-work/). We *do* actually support Universal Links now: here is our docs page for how to enable them: https://dev.branch.io/getting-started/universal-app-links/overview/ – Alex Bauer Mar 04 '16 at 17:11
  • 1
    @RockyPerera So finaly @alex-bauer from `Branch.io` [here](http://stackoverflow.com/questions/35788814/branch-io-deeplink-not-working-in-safari-in-ios-9-but-it-works-in-chrome/35801909#35801909) – Vineet Choudhary Mar 04 '16 at 18:41