4

I'm looking for functionality where when a user receives a message - let's say through the WhatsApp app - containing a link starting with a certain scheme (prefix), my app will be invoked when the user taps on that link.

I understand that this feature is already available as "custom URL schemes" but I also noticed now that Universal Links have a similar thing. So, is there any issue with "custom URL schemes"? I don't want to use Universal Links because I don't want my app to be restricted to iOS 9.

Moreover, it looks like Android also has this feature of customer URL, but again, on the latest Android version 6.0, it's mentioned here that they also have "App Links" feature which only works on Android 6.0. So, again, what is the difference between the two?

I don't want to restrict my app to work on only iOS9 or Android 9. So I guess the traditional "custom URL schemes" is more attractive for me for the time being.

Also, I want to make sure that "custom URL schemes" will work when a user taps on a link on WhatsApp or it will only work if the link on the web browser or mail.

2
  • 1
    I would have asked the same, if you wouldn't have done this before. ;) Especially I'm interested in the difference of URL-schemes and App-Links (which are http-prefixed as I understand), a part from the fact, that URL-schemes might not be opened in a browser as they're designed App-only. Right? Commented Dec 7, 2015 at 11:22
  • 2
    This custom URLS / Universal Links / App Links thing is the trickiest, ugliest, most always-changing thing I stumbled upon in a long time. Been digging it for months, still I don't get the difference and apparently I'm not able to make any of them work properly :-( Commented Apr 6, 2016 at 14:01

1 Answer 1

1

URLs with custom schemes don't get displayed as links in many Android applications (SMS, E-Mail, WhatsApp, Hangouts, you name it), which de facto make them unopenable by your application. iOS however does not allow for defining scheme + host + path like android does.

One possible (hacky) solution to this is browser sniffing (I know, evil, but so are non-standard extensions to well-defined behavior, especially if nothing was broken in the first place) at the resource you expose over a URL reachable over HTTP(s).

You could check if the request origins from the iOS-platform you offer native apps for; then you would have to make sure that the device has your application installed (this is getting uglier and uglier; see here for example) and then, only then redirect to yourapp://the-rest-of-your/uri, which causes a prompt shown to the user whether they want to open the address inside the application or not. (Tested on an iPhone 4 with iOS 8, Safari browser.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.