I am trying to implement setup Universal Link for IOS 9 device with both side configuration.Firstly I have done configuration at server Side with steps:
1.created one unsigned apple-app-site-association-unsigned.txt file and file contents is
{
"activitycontinuation": {
"apps": [
"9JA89QQLNQ.com.apple.wwdc"
]
},
"applinks": {
"apps": [],
"details": [
{
"appID":"9JA89QQLNQ.com.apple.wwdc",
"paths": [
"*",
"/"
]
}
]
}
}
2.Did sign the above mentioned file using
cat apple-app-site-association-unsigned.txt | openssl smime -sign -inkey demo.key -signer demo.crt -certfile demo.pem -noattr -nodetach -outform DER > apple-app-site-association
3.then it is created on signed file i.e apple-app-site-association
4.moved this file into root server where my certificates are available.
5.created one endpoint with node.js
var https = require('https');
var fs=require('fs');
var express = require('express');
var privateKey = fs.readFileSync(home_path + 'src/Server/API/demo.key', 'utf8');
var certificate = fs.readFileSync(home_path + 'src/Server/API/demo.crt', 'utf8');
var credentials = {key: privateKey, cert: certificate};
var app = express();
var httpsServer = https.createServer(credentials, app);
httpsServer.listen(8443);
console.log('deeplink service listening on port 3501');
var aasa = fs.readFileSync('./apple-app-site-association');
app.get('/apple-app-site-association', function(req, res, next) {
console.log("Request landed on 8443 port.");
res.set('content-type', 'application/pkcs7-mime');
res.status(200).send(aasa);
});
6.then my end point is:- https://domain.com:8443/apple-app-site-association
7.My app is not installed in device then if I copied universal link i.e https://domain.com:8443/apple-app-site-association in Ios 9 safari browser,it is not redirecting to App store, instead of that it is displaying apple-app-site-association file to download.
Note:- I did only server side configuration,so that if my app in not installed it should redirect to app store.
Any idea on this where I am wrong?
I believe you may be fundamentally misunderstanding how Universal Links work. You should do some additional research into Universal Links to make sure you have the concept correct. This might be a good place to start.
That said, a few things that may help:
apple-app-site-association
file. It will not check on port 8443. The easiest option is to use the standard HTTPS port (443), but assuming your signing attempts are valid, non-HTTPS should also work (port 80).https://domain.com/apple-app-site-association
(extraneous port reference removed) itself is not a Universal Link. This is simply a validation file you need to host so that when you implement Universal Links in your app, iOS is able to confirm you own and control the domain in question.Many apps don't even attempt to handle all of this complexity, especially since Universal Links are still only a partial solution to deep linking (they don't work in Facebook, Twitter, or any app using SFSafariViewController
, amongst others), so you may want to look into an external link routing service. Branch.io (full disclosure: I'm on the Branch team) is a good option and handles all of these technical details for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With