iOS link handling
Dimitri James Tsiflitzis
1. URL Schemes
2. Universal Links
Using URL Schemes to Communicate with Apps
● Easy to setup & define
● Even easier to use
● Available in older iOS versions with some limitations on iOS9
Registering Custom URL Schemes
In your plist
If more than one third-party app registers to handle the same URL scheme ¯\_(ツ)_/¯
Handling URL Requests
E.g. meetup://events/229782259 (scheme://host/path?query)
Check if a URL scheme is available
Preparing for URL Schemes in iOS9
● Add schemes checked using canOpenURL to the plist
Some extra stuff
● Visit http://handleopenurl.com/ to get a list of schemes
● Use custom URL schemes to have a Today Extension
communicate with your app
Using Universal Links (from the docs)
● Unique. Unlike custom URL schemes, universal links can’t be claimed by
other apps, because they use standard HTTP or HTTPS links to your website.
● Secure. When users install your app, iOS checks a file that you’ve uploaded
to your web server to make sure that your website allows your app to open
URLs on its behalf. Only you can create and upload this file, so the
association of your website with your app is secure.
● Flexible. Universal links work even when your app is not installed. When your
app isn’t installed, tapping a link to your website opens the content in Safari,
as users expect.
● Simple. One URL works for both your website and your app.
● Private. Other apps can communicate with your app without needing to know
whether your app is installed.
Adding support for Universal links
● Create an apple-app-site-association file that contains JSON data about
the URLs that your app can handle.
● Upload the apple-app-site-association file to your HTTPS web server.
● Prepare your app to handle universal links.
Add a apple-app-site-association to the root of your server (prefix can be found in
● Add an entitlement that specifies the domains your app supports.
● Update your app delegate to respond appropriately when it receives the
Some extra stuff
● Work in SFSafariViewController, don’t work in UIWebView
● Debugging the apple-app-site-association is hard
● Some popular app don’t support them, e.g. gmail
● Actions are remembered