如何回应`apple-app-site-association`请求

时间:2016-07-11 06:42:40

标签: ios ios-universal-links

由于缺少Set文件,我在日志文件中看到404 not found个错误。

据我所知,该文件的目的是告诉iOS设备设备可能需要使用哪些应用程序与服务器通信。但该网站是一个完全静态的网站,并没有发布iOS应用程序。

我想知道对这样一个请求的适当回应是什么?

  • 保持/.well-known/apple-app-site-association?因为除了普通的Web浏览器之外没有iOS应用程序,因此该文件在静态非交互式网站的上下文中没有意义。

  • 或者这有一些空的或默认的404 not found文件应该返回而不是apple-app-site-association?我觉得这可能是有道理的,因为当我知道iOS设备正在查询该文件时,至少应该返回某些东西 - 就像404 not found一样只是告诉我们什么都没有阻止。

3 个答案:

答案 0 :(得分:0)

我不认为iOS设备会查询该文件,Apples机器人会这样做,它可以构建内容的索引和应用程序的映射。聚光灯/野生动物园可能会根据需要查询它,不确定。这是深度链接/聚光灯搜索的一部分。如果你没有应用程序,我根本不担心。

答案 1 :(得分:0)

iOS devices will attempt to load this file if an application explicitly specifies your domain. It would be unusual indeed if an app was requesting your domain without your knowledge, so probably not a situation worth worrying about.

More likely this is either applebot or googlebot performing a regular indexing operation. Both Apple and Google now use the apple-app-site-association file to check if your site contains app content, so they appear to be checking for it as a regular part of the crawling process. Of course, there is no official documentation about this!

Returning 404 is the expected failure state, as far as I know. This is a file that should only be present on an opt-in basis.

答案 2 :(得分:0)

Imo,如果您没有iOS应用,则对.well-known/apple-app-site-association的响应几乎是无关紧要的。
它应该拥有的是您的Apple应用程序捆绑包ID和路由信息,以启用通用链接,授权和所有爵士乐。

就像robots.txt,但仅适用于Apple生态系统。


更多阅读内容: