alp*_*urt 6 ios ios-universal-links
我已经将我的apple-app-site-association文件上传到我的HTTPS Web服务器的根目录之后,我在xcode中添加了我的Associated Domains.我已经关注了apple通用链接教程.
[SWC] ###拒绝重定向到" https://examplecustomdomain.com/apple-app-site-association/ "(原始" https://examplecustomdomain.com/apple-app-site-association ")
我检查了我的设备日志,我看到上面的错误
最近试图实现通用链接功能进入同样的问题.fbeeper做出了很好的回应,帮助我确认确实存在重定向.
但是,它无法帮助我确定如何解决重定向问题.因此,对于像我这样使用基于Ruby on Rails的后端的人来说,这是一个如何以满足Apple所有要求的方式提供这个讨厌的apple-app-site-association文件的示例:
apple_app_site_associationjson文件放在该public文件夹中config/routes.rb文件中,添加如下行:get '/apple-app-site-association' => 'home#apple_app_site_association'
然后在相关的控制器文件(本例中为home_controller)中,定义您的方法:
def apple_app_site_association
association_json = File.read(Rails.public_path + "apple-app-site-association")
render :json => association_json, :content_type => "application/pkcs7-mime"
end
我遇到了一个非常相似的错误:
[SWC] ### Denying redirect to 'https://www.<domain>/apple-app-site-association' (original 'https://<domain>/apple-app-site-association')
Run Code Online (Sandbox Code Playgroud)
引用苹果的文档:
该文件必须托管在具有有效证书的 https:// 网站上(例如,Safari 在查看该网站时不得发出证书警告)。
该文件不得使用任何重定向。
该文件必须具有 MIME 类型 application/pkcs7-mime。
我的猜测是,对于我们双方来说,该文件都可以获得,但它是在重定向之后获得的。即使操作系统位于同一域下,也不会遵循该重定向;而且,显然,在日志上对此有所抱怨。
运行curl -i https://<domain>/apple-app-site-association你可能会看到HTTP/1.1 301 Moved Permanently, with Location: https://www.<domain>/apple-app-site-association(或类似的)。
| 归档时间: |
|
| 查看次数: |
4147 次 |
| 最近记录: |