我已将我的 apple-app-site-association 文件上传到我的 HTTPS Web 服务器的根目录之后,我已在 xcode 中添加了我的关联域。我已遵循 Apple 通用链接教程。
[SWC] ### 拒绝重定向到 'https://examplecustomdomain.com/apple-app-site-association/ https://examplecustomdomain.com/apple-app-site-association/' (原来的 '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_association
json 文件中的public
folder
- In your
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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)