0

I just stumbled upon the concept of deep links, allowing people to send data to the app using specific URL's. I looked into this, and I have now successfully managed to implement it in my app. However, I have one question. I was wondering if it was possible to detect if the app was installed or not, while clicking the specific link in for example Notes or on Safari - and if not - take the person to the App Store.

Is this possible?

Thanks in advance.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
askaale
  • 1,199
  • 1
  • 23
  • 50
  • This is not a question of swift ..I guess javascript. – LC 웃 Nov 14 '16 at 05:08
  • maybe this answer could help you: http://stackoverflow.com/questions/1108693/is-it-possible-to-register-a-httpdomain-based-url-scheme-for-iphone-apps-like/1109200#1109200 – John Lee Nov 14 '16 at 07:01
  • @JohnLee unfortunately that thread is seven years old now. Things have changed considerably since then, and this approach no longer works well. – Alex Bauer Nov 14 '16 at 17:54

1 Answers1

0

Yes, this is possible. However it requires some workarounds, because you can't actually detect if an app is installed in situations like this. Apple and Google have limited that for obvious privacy reasons.

The basic flow is this:

  1. Attempt to open the app via a deep link (Universal Links in most situations, or a custom URI scheme redirect wrapped inside a regular HTTP/HTTPS link in rare cases)
  2. If this attempt fails, use your fallback URL (the actual URL of a Universal Link, or the page where you wrapped your custom URI scheme redirect) to then forward the user to the App Store to download.

The real magic happens when you are able to do deferred deep linking. This means storing the value of the deep link remotely so you can send the user to the right place in your app, even when the app is not installed yet.

This is exactly how Branch.io (full disclosure: I'm on the Branch team) works. You can find a much better overview of the process on this page.

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44