苹果应用程序站点关联文件将不会下载 [英] Apple-app-site-association file won't download

查看:105
本文介绍了苹果应用程序站点关联文件将不会下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的apple-app-site-association文件上传到HTTPS Web服务器的根目录之后,在xcode中添加了我的关联域.我遵循了苹果通用链接教程.

I have uploaded my apple-app-site-association file to the root of my HTTPS web server After, I have added my Associated Domains in the xcode .I have followed apple universal link tutorial.

[SWC] ###拒绝重定向到' https://examplecustomdomain.com/apple-app-site-association/"(原始的" https://examplecustomdomain.com/apple-app-site-association ')

[SWC] ### Denying redirect to 'https://examplecustomdomain.com/apple-app-site-association/' (original 'https://examplecustomdomain.com/apple-app-site-association')

我已经检查了设备日志,并且看到了类似上面的错误

I have checked my device logs and I have seen error like above

推荐答案

最近遇到同样的问题,试图实现通用链接功能.fbeeper给出了很好的响应,这帮助我验证了确实存在重定向.

Ran into this same issue recently trying to implement Universal Links functionality. fbeeper gave a good response that helped me validate that there was indeed a redirect occurring.

但是,它没有帮助我确定如何解决重定向问题.因此,对于像我这样使用基于Ruby on Rails后端的人来说,这是一个示例,该示例说明了如何以符合Apple所有要求的方式来提供该讨厌的apple-app-site-association文件:

However, it didn't help me in determining how to resolve the redirect issue. So for those like myself that are working with a Ruby on Rails based backend, here's an example of how to serve that pesky apple-app-site-association file in a way that meets all of Apple's requirements:

  • 将您的 apple_app_site_association json文件放置在 public 文件夹中
  • 在您的 config/routes.rb 文件中,添加如下一行:
  • Place your apple_app_site_association json file in the public folder
  • In your config/routes.rb file, add a line like:

get'/apple-app-site-association'=>'home#apple_app_site_association'

  • 然后在相关的控制器文件(在本示例中为home_controller)中,定义您的方法:

  • Then in the relevant controller file (home_controller in this example), define your method:

def apple_app_site_associationassociation_json = File.read(Rails.public_path +"apple-app-site-association")渲染:json => association_json,:content_type =>"application/pkcs7-mime"结尾

这篇关于苹果应用程序站点关联文件将不会下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆