苹果应用程序站点关联不起作用 [英] Apple-app-site-association is not working
问题描述
我已经实现了 apple-app-site-association
与我的iOS应用进行深度链接.
我创建了不带扩展名的.JSON文件,并将其放置在网站的根目录中.
现在,我可以看到文件为 https://example.com/apple-app-网站关联在任何浏览器上.
I have implemented apple-app-site-association
for deep linking with my iOS app.
I have created the .JSON file without extension and placed to my website's root directory.
Now, I can see the file as https://example.com/apple-app-site-association on any browser.
以下是apple-app-site-association文件中的json正文-
Following is the json body inside the apple-app-site-association file -
{
"applinks": {
"apps": [],
"details": [
{
"appID": "AppID.bundleIdentifier",
"paths": [ "*"]
}
]
}
}
仅供参考,我在网站的(angular.js).htaccess中添加了以下内容-
FYI I have added following inside my website's(angular.js) .htaccess -
<FilesMatch "^apple-app-site-association$"> ForceType application/json </FilesMatch>
我已经在Xcode和developer.apple.com中启用了关联域".
但是,当我尝试安装新的版本时,它不起作用.
通过浏览设备日志,我收到以下错误消息.
请注意一下,并协助我解决我做错的事情.
I have already enabled the "Associated Domain" in both Xcode and developer.apple.com.
But, when I am trying to install a new build, its not working.
By digging into the device log, I am getting the following error.
Please take look and assist me about what I am doing wrong.
[SWC] ###错误的apple-app-site-association JSON:错误Domain = NSCocoaErrorDomain代码= 3840"JSON文本开头不是数组或对象以及允许未设置片段的选项."UserInfo = {NSDebugDescription = JSON文本不是以数组开头或对象和允许未设置片段的选项.}
[SWC] ### Bad apple-app-site-association JSON: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
推荐答案
将 .well-known/
添加到您的路径:
https://<完全限定的域>/.well-known/apple-app-site-association
来自 https://developer.apple.com/documentation/safariservices/supporting_associated_domains_in_your_app
这篇关于苹果应用程序站点关联不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!