Handoff and Universal Links failed on iOS 9
I am setting up my apple-app-site-association file following this : Transfer of service works on iOS 8, but transfer of service does not work on iOS 9. I set up a free hosting site and upload the apple-app-site-association application file to the root site directory: universallink.net46.net 1. I created a JSON file and named it handoff.json:
{
"activitycontinuation":
{
"apps": ["XXXXXXXXXX.com.home.handoff"]
},
"applinks":
{
"apps":[],
"details":
{
"XXXXXXXXXX.com.home.handoff":
{
"paths":["*"]
}
}
}
}
XXXXXXXXXX here is the command ID of the distribution grant profile
- I used Keychain Access app to export iPhone distribution certificate to Certificates.p12 key.
- I signed the JSON file using the following commands:
Create certificate in openssl command.
openssl pkcs12 -in Certificates.p12 -clcerts -nokeys -out output_crt.pem
Create a secret key.
openssl pkcs12 -in Certificates.p12 -nocerts -nodes -out output_key.pem
Create an intermediate certificate.
openssl pkcs12 -in Certificates.p12 -cacerts -nokeys -out sample.ca-bundle
Sign the handoff.json file with the following command.
cat handoff.json | openssl smime -sign -inkey output_key.pem -signer output_crt.pem -certfile sample.ca-bundle -noattr -nodetach -outform DER> apple-app-site-association
- I have uploaded the signed file "apple-app-site-association" to the root of the universalallink website
- I configured the right:
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>activitycontinuation:www.universallink.net46.net</string>
<string>activitycontinuation:universallink.net46.net</string>
<string>applinks:www.universallink.net46.net</string>
<string>applinks:universallink.net46.net</string>
</array>
</dict>
- I am implementing the function app: continueActivity .... and it returns YES.
- I installed the app on an iOS 9 beta 4 device and also installed Certificateates.p12 in step 3 on the device.
- I sent a message to myself a link to the site allallink
- I expected the application to launch, but it is actually Safari.
I don't know if I did anything wrong.
source to share
You are signing it wrong. You need
and a key for an identity issued by a CA trusted by iOS
See the official apple documentation here: https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/Handoff/AdoptingHandoff/AdoptingHandoff.html#//apple_ref/doc/uid/TP40014338-CH2- SW10
source to share
I tried to get it to work using a local server (python https OTA server) with a self-provisioned certificate using SSL and it didn't work. I could track the connection and listen to the channel, but in the various tests I tried, the json file was never requested, so there is a problem, SSL certificate. Go to: https://support.apple.com/en-gb/HT205205 , as "not all root certificates" are supported by apple (most are though).
source to share