我正在按照本教程设置我的 apple-app-site-association 文件:Handoff 适用于 iOS 8,但 handoff 在 iOS 9 上不起作用。我设置了一个免费托管站点并将 apple-app-site-association 文件上传到网站根目录:universallink.net46.net 1. 我创建了一个 JSON 文件并将其命名为 handoff.json:
{
"activitycontinuation":
{
"apps": ["XXXXXXXXXX.com.home.handoff"]
},
"applinks":
{
"apps":[],
"details":
{
"XXXXXXXXXX.com.home.handoff":
{
"paths":["*"]
}
}
}
}
这里的 XXXXXXXXXX 是分发配置文件的团队 ID
- 我使用 Keychain Access 应用程序将 iPhone 分发证书导出到 Certificates.p12 密钥。
- 我使用以下命令签署了 JSON 文件:
在 openssl 命令中创建证书。
openssl pkcs12 -in Certificates.p12 -clcerts -nokeys -out output_crt.pem
创建一个密钥。
openssl pkcs12 -in Certificates.p12 -nocerts -nodes -out output_key.pem
创建中间证书。
openssl pkcs12 -in Certificates.p12 -cacerts -nokeys -out sample.ca-bundle
使用以下命令对 handoff.json 文件进行签名。
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
- 我将签名文件“apple-app-site-association”上传到网站universallink的根目录
- 我配置了权利:
<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>
- 我实现了函数 application:continueActivity.... 并返回 YES。
- 我在 iOS 9 beta 4 设备上安装了该应用程序,并且还在第 3 步将 Certificates.p12 安装到了设备中。
- 我给自己发了一条消息universallink网站的链接
- 我预计我的应用程序会启动,但实际上,它是 Safari。
我不知道我是不是做错了什么。