Dec 24, 2015
When iOS 9.2 was released on Dec 8th, thousands of app developers suddenly realized their app experience was broken. A small change in Safari’s handling of deep links resulted in many sleepless nights for the app community that was struggling to prepare for the holiday shutdown. It was an untimely yet inevitable change.
We saw this coming in the iOS 9.2 beta but were hopeful that our Apple radars (bug reports) and influential partners could motivate Apple to resolve it before release. Unfortunately for iOS developers, it was not to be. Apple’s response to our concerns made perfectly clear what they wanted everyone to do: adopt Universal Links.
So be it.
This is a significant change to the traditional way you would handle routing users who already have your app installed. Previously, you would open up the app directly from Safari when a user clicked on your link or visited your website. No more.
URI schemes received the deep link URL through
openUrl in the App Delegate. Universal Links receive their data via a different code path:
continueUserActivity. This new delegate method is used for a number of app transitions, ranging from Spotlight to Universal Links, and will likely see a couple more use cases introduced in future OS versions.
Below is a snippet of code that you can use to retrieve the full Universal Link URL that opened the app.
Warning: Don’t go ripping out your URI scheme code just yet.
Despite Apple’s aggressive move towards Universal Links, there are still a lot of edge cases which Universal Links does not support. See them below.
As you’re reading, you’re probably wondering if you can use your old URI schemes and deep link routing. Let’s say that you previously had all of your routing in a method in the App Delegate named
handleRouting. You can simply grab the webpageUrl from the user activity and pass it to handle routing like so:
The URLs might be different from your traditional URI schemes, so you just need to have that logic split out in the handleRouting call.
Unfortunately, Universal Links are not supported on a lot of the browsers and apps that people will be clicking your links from. You can see a list that we’ve accumulated below.
Not working means that these apps do not respect Universal Links. Every single time you click a Universal Link in one of these apps, the in-app browser will open and the web page will load. Make sure you still employ you URI scheme based deep linking here or your users will be taken to the website even if they have the app installed.
Works conditionally means that there are certain circumstances where the link will behave as a Universal Link, and others where it will not. The following circumstances for ‘clicking’ a link do not respect the Universal-ness of a link:
As you can tell, there are a lot of edge cases when it comes to using Universal Links in production. If you don’t want to have to worry about upgrading your linking infrastructure every time there is a change, Branch will handle all of this for you.
In addition to the benefits of Universal Links, when you use Branch you get deep linking through install, attribution, and analytics from a robust service that powers thousands of apps.
Don’t be left in the dark. Sign up today.