Deep Linking & Universal Linking - Are they same or different??
Ever since Apple introduced Universal Links in iOS 8, a confusion comes into the developers mind is Deep Linking & Universal Linking the same or different?
In the below article I would focus on the business differences and not implementation differences. It is given that the implementation of Deep linking & Universal linking will differ.
The underlying truth is they help solve the same problem statement and that is launching my app via external urls / links.
The only difference between deep linking & universal linking is - universal links will help us in securely launching the app.
How is Universal Links Secure?
With Deep Links (Custom URI's) any rogue app can subscribe to open the same URL's, where as with universal links, the 'apple-app-site-association' file is downloaded from the host server.
The apple-app-site-association contains the bundle identifier & team identifier of the app that is tied with the web, it virtually provides the secure handshake.
Where do I need to upload the 'apple-app-site-association' file?
The file needs to be uploaded to the root level 'www.abc.com' or at the folder level 'www.abc.com/.well-known/'.
Even after uploading the file, if universal links are not working there can be two main reasons:
- Once user has selected to open the link in browser, apple would not ask the next time. To fix this we need to clear safari browser cache & history.
- While installing the app, connect your device to mac and capture the logs. Check for log statements which shows that apple tried to download the 'apple-app-site-association' file. If it fails, the Universal links will not work.
Does the same concept exists in Android as well?
Yes, universal links works in Android as well, they are called as 'App links' in Android. Instead of 'apple-app-site-association', we need to upload 'assetlinks.json'
Both the files needs to be uploaded at the root level or within the folder .well-known
Using app links in Android will launch the specific app and deep links in Android will display the 'app chooser' which should be launched.
Conclusion:
I would recommend to use universal links and say good bye, sayonara to deep links.
P.S : Do remember, the deep links explained above is not related to launching of different screens in the app using Push Notifications.