Hi All,
Struggled hard to implement the UNIVERSAL LINKS. A nice but confusing procedure.
What are Universal Links
Universal links are the way to implement deep linking on iOS 9 and above.
Earlier defining Custom URL Scheme was the only simplest way to achieve deep-linking but now the Associated Domains come into picture for handling deep-linking.
En-route to Implementation part...
***** Xcode Layer *****
Step 1 :
- Open your xCode Project
- Goto Target
- Click General
- Set Bundle Identifier (Example : com.blog.spot )
Step 2 :
- Click Capabilities
- Enable Associated Domains
- Click + in Domains and write (Example : applinks:india.com/apple-app-site-association)
Step 3 :
- On Enabling Associated Domain a file Target.entitlements gets added in your project.
- Please ensure this gets added in Targets Membership and the build.
- You can view this in Identity Inspector.
Step 4 :
- Click Build Settings
- Under Signing Sections you can find Name of your Code Signing Entitlements as Target.entitlements
Step 5 :
- Click Info.plist file.
- Add URL Identifier as com.blog.spot under Url Types.
- Add URL Scheme as com.blogspot under Url Types.
- Open Apple Developer Program.
- Enable Associated Domains for your App Identifier.
- Use the new certificate and provisioning profile for Build installation.
***** Server Layer *****
- Buy a domain or use any existing one.
- Acquire SSL Certification for it.
- Create a JSON File : apple-app-site-association.
- Upload this file on the server.
- It must return 200 http code.
- Content type of File Must be proper.
- For Verification you can use : https://limitless-sierra-4673.herokuapp.com/
JSON Structure{ "applinks": {
"apps": [],
"details": [{
"appID": "AB123CD4EF.com.blog.spot",
"paths": ["*"]
}]
}
}
AB123CD4EF.com.blog.spot
| |
↓ |
Team Id ↓
Bundle Identifier
Verification
- Create an HTML page and place on any server.
- On page load call a method say open.
function open() { window.location = "blogspot://?user=100"; }
- Now goto Safari App, refresh and a popup must be visible.
- Click Open and it should be redirected to your installed App
- However if App is not installed an error pop up will display
Notes:
- Universal Links do not work with redirects.
- With Gmail Universal Links perfectly fine.
- Do not append .json in apple-app-site-association file
No comments:
Post a Comment