我有一个 EXPO 应用程序,我正在尝试从外部链接(通用/深层链接)进入该应用程序,Android 已正常启动并运行,而 IOS 无法正常工作。app.json 文件的配置如下所述:
"associatedDomains": [
"applinks:*.<DOMAIN_NAME>.com",
"applinks:<SUB_DOMAIN>.<DOMAIN_NAME>.com"
]
Run Code Online (Sandbox Code Playgroud)
由于我的应用程序使用原始网站的 WEBVIEW,因此文件 /.well-known/apple-app-site-association 位于我的客户端存储库中的 SRC 文件夹下,如下所示:
Content-Type: application/pkcs7-mime
{
"applinks": {
"apps": [],
"details": [{
"appID": "<APP_ID>",
"paths": ["/login/*"]
}]
}
}
Run Code Online (Sandbox Code Playgroud)
现在,AASA 验证器正常,但外部链接仍然无法打开本机应用程序!该怎么办?!
cod*_*ard 22
我在世博会论坛上找到了答案,并想在这里发布解决方案,因为我花了几个小时/几天的时间试图找出答案。并一直在这里遇到这个问题。并且由于只能在生产中轻松测试(相对于本地或发布渠道部署)。我希望避免其他用户因发布具有损坏的通用深度链接的应用程序而带来的痛苦。
世博会的文档在这里不清楚。在 iOS 部分,Expo 的链接指南相当模糊,有些语言不够明确或不够清晰。更糟糕的是,你在 SO 或其他地方找到的所有内容都充满了相互冲突和过时的信息。
虽然OP的问题很可能仅通过此列表中的最后一项来解决,但我想介绍一些我在为后代解决这个问题时遇到的问题,并澄清我一直在努力拼凑的事情:
well-known [文档],我建议将其放在两者上,因为这将有助于创建一些冗余。您可以上传一个文件并配置您的服务器来解析同一文件。Certificates, Identifiers & Profiles> identifiers> 单击与您的应用程序包 ID 匹配的标识符 > capabilities> 检查“关联域” 它会告诉您,这将使您的签名配置文件无效,并且您需要一个新的签名配置文件来部署您的应用程序。只要您处于托管 expo 应用程序中,expo 就会在您创建新版本时为您处理此问题。另一位用户在博览会论坛上深入解释了这个解决方案- 我不会深入探讨,但会包括他对我有用的不同模式的组合,以便更容易找到。(尽管如果您不打算支持低于 iOS 13 的任何版本,新架构可能就足够了。因为 15 是撰写本文时的当前版本)
所有架构组合的示例。
{
"applinks": {
"apps": [],
"details": [
{
"appIDs": [ "TEAMID.bundleidentifier", "ABCDE12345.com.example.app2" ],
"components": [
{
"#": "no_universal_links",
"exclude": true,
"comment": "Matches any URL whose fragment equals no_universal_links and instructs the system not to open it as a universal link"
},
{
"/": "/buy/*",
"comment": "Matches any URL whose path starts with /buy/"
},
{
"/": "/help/website/*",
"exclude": true,
"comment": "Matches any URL whose path starts with /help/website/ and instructs the system not to open it as a universal link"
},
{
"/": "/help/*",
"?": { "articleNumber": "????" },
"comment": "Matches any URL whose path starts with /help/ and which has a query item with name 'articleNumber' and a value of exactly 4 characters"
}
]
},
{
"appID": "TEAMID.bundleidentifier",
"paths": [ "/buy/*", "/help/website/*", "/help/*" ]
},
{
"appID": "OTHTEAMID.otherbundleidentifier",
"paths": [ "/blog", "/blog/post/*" ]
},
{
"appID": "YAOTHTEAMID.yetanotherbundleidentifier",
"paths": [ "*" ]
}
]
},
"activitycontinuation": {
"apps": [
"TEAMID.bundleidentifier",
"OTHTEAMID.otherbundleidentifier"
]
}
Run Code Online (Sandbox Code Playgroud)
新架构示例(如果您不需要支持旧版本的 iOS)
{
"applinks": {
"apps": [],
"details": [
{
"appIDs": ["ABCDE12345.com.example.app", "ABCDE12345.com.example.app2"],
"components": [
{
"#": "no_universal_links",
"exclude": true,
"comment": "Matches any URL whose fragment equals no_universal_links and instructs the system not to open it as a universal link"
},
{
"/": "/buy/*",
"comment": "Matches any URL whose path starts with /buy/"
},
{
"/": "/help/website/*",
"exclude": true,
"comment": "Matches any URL whose path starts with /help/website/ and instructs the system not to open it as a universal link"
},
{
"/": "/help/*",
"?": { "articleNumber": "????" },
"comment": "Matches any URL whose path starts with /help/ and which has a query item with name 'articleNumber' and a value of exactly 4 characters"
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2584 次 |
| 最近记录: |