0

我正在按照教程设置我的 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

  1. 我使用 Keychain Access 应用程序将 iPhone 分发证书导出到 Certificates.p12 密钥。
  2. 我使用以下命令签署了 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
  1. 我将签名文件“apple-app-site-association”上传到网站universallink的根目录
  2. 我配置了权利:
<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>
  1. 我实现了函数 application:continueActivity.... 并返回 YES。
  2. 我在 iOS 9 beta 4 设备上安装了该应用程序,并且还在第 3 步将 Certificates.p12 安装到了设备中。
  3. 我给自己发了一条消息universallink网站的链接
  4. 我预计我的应用程序会启动,但实际上,它是 Safari。

我不知道我是不是做错了什么。

4

3 回答 3

2

你签错了。你需要一个

由 iOS 信任的证书颁发机构颁发的身份的证书和密钥

在此处查看苹果官方文档:https ://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/Handoff/AdoptingHandoff/AdoptingHandoff.html#//apple_ref/doc/uid/TP40014338-CH2-SW10

于 2015-08-13T22:33:01.957 回答
1

我认为这:

 "details":
        {
            "XXXXXXXXXX.com.home.handoff":
            {
                "paths":["*"]
            }
        }

应该是这样的:

   "details": [{
        "appID": "XXXXXXXXXX.com.home.handoff",
        "paths": ["*"]
     }]
于 2016-04-05T15:53:04.140 回答
0

我试图通过使用本地服务器(OTA https python 服务器)和使用 SSL 的自创证书来使其工作,但它没有工作。我可以跟踪通信并收听频道,但在我尝试的不同测试中,从未要求过 json 文件,因此存在问题,即 SSL 证书。转到:https ://support.apple.com/en-gb/HT205205 ​​,因为苹果支持“并非所有根证书”(但其中大部分都支持)。

于 2015-11-24T11:09:26.690 回答