I want to open app from an external link, for example a link that I get in iMessage
, the question is, I should use deepLink
or universalLink
, I want to open the app when I tap on the link, then having ability to read the url in the app is enough for me.
And for this matter, I should set a Json file in the website as well? something like this:
https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app
It's a bit confusing for me, could anyone gives me a real example and steps?
Thank you
CodePudding user response:
Yes, basically both the app itself and the website need to be aware that you are going to be using Universal Links. There are a few steps to do this:
First you need to include the website as an Associated Domain inside of your Xcode project.
Then for the website you do have to create what is known as the apple-app-site-association file. This lets the the website know which apps are associated with the website.
- This tutorial has a step by step on How to setup your website to work Universal Links.
Lastly you will have to have to update your AppDelegate
file to handle when a Universal link opens the application.
- More info can be found in the official Apple Documentation on Creating Universal Links.