URI Schemes

What are URI Schemes? Are they different from URLs?

If you want to start a riot in a room full of engineers, you could have a debate about tabs vs. spaces for code indentation. Or you could mix up the difference between “URI and URL.” Essays have been written about this, but for our purposes just remember that all URLs are also URIs. The important part is the piece at the beginning: the “scheme”. You’re already familiar with the http:// and https://schemes. You may even have encountered ftp:// or feed://. All of these indicate the type of content being requested, and your mobile app can register its own custom URI scheme. For example, myapp://.

If you are researching deep links, you probably have come across significant content about URI schemes. Facebook is such a case, where URI schemes are the main way you can deep link from a retargeting campaign into an app. Throughout much of the history of app development, URI schemes were the primary method of deep linking into apps on both iOS and Android.

The Limitations of URI Schemes

Unfortunately, there are significant drawbacks to custom URI schemes, most notably the inability to easily handle these two situations:

  • When the app isn’t installed.
  • When more than one app tries to claim myapp://.

URI schemes have no built-in fallback option, meaning that if a user doesn’t have an app installed when clicking a link shared by a friend, they will simply see an error page. There is also no central registration system, meaning URI collisions can happen (Apple’s official stance is “there is currently no process…”). Many developers built workarounds for the first issue using complicated JavaScript redirects, but these tended to break with each new iOS release. There will likely never be a solution for the second issue. Because of these limitations, both iOS and Android have developed second generation deep linking standards known as Universal Links and App Links, respectively. Apple has since blocked the JavaScript redirection approach to URI schemes, making Universal Links essential for iOS deep linking. App Links have far seen far lower adoption.

Are URL/URI Schemes Obsolete?

According to Apple, yes. Starting from iOS 9.2, Apple no longer officially supports URI schemes for deep linking, and developers were forced to implement Universal Links in order to get equivalent functionality on iOS.

In reality, not yet. Universal Links are great when they work, but there are still plenty of places where you need to use URI schemes as a backup and you are leaving a significant amount of traffic on the table if you rely on them exclusively. The Android ecosystem is far too fragmented to even consider abandoning URI schemes at any point in the near future.

Ready to ignite your mobile growth?

Take a tour of our platform to see how Branch can help you everywhere. Or jump right into the code.