配置apple-app-site-association文件并在服务器上上传 [英] Configure apple-app-site-association file and upload on server

查看:2170
本文介绍了配置apple-app-site-association文件并在服务器上上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS开发的新手.我正在用ASP.net应用程序在iOS App中实现通用链接.
我在关联域"下的功能中定义了我的关联域: applinks:www.abcd.com
并在Apple Developer Account的App Ids中进行配置.我认为应用程序方面的工作已经准备就绪.

I am new on iOS development. I am implementing Universal Links in iOS App with ASP.net application.
I have define my associate domain in capabilities under Associated Domains: applinks:www.abcd.com
And also configure in App Ids on Apple Developer Account. I think app side work is all set .

但是我认为apple-app-site-association文件有问题.

But I think problem with apple-app-site-association file.

我已经在如下所示的简单文本文件中编写了json

I have written json in a simple text file like below

{
  "applinks": {
    "apps": [],
    "details": [
    {
      "appID": "8T8932TY.com.AppName",
      "paths": ["*"]
    }
    ]
  }
}

现在我被困在这里.我的应用程序定位于iOS 9及更高版本.我对使用apple-app-site-association命名该文件的扩展名感到困惑.是否需要使用新证书登录.以及如何在服务器端上传.

Now I am stuck here. My application targeting on iOS 9 and above. I am confused that what is the extension of this file with naming apple-app-site-association. If I need to signed in with new certificates or not. And how upload it on server side.

请大家帮帮我.我为此进行了大量搜索,但未获得满意的答案.

Please guys help me out. I am searching lot for this but not get satisfactory answer.

谢谢

推荐答案

如果用真实的AppID/AppName值替换,示例JSON看起来很好.您可能想具体说明要处理的路由,但这取决于您-更好的用户体验是,仅尝试处理有可能处理的路由,而不是为应用程序上的每个链接打开应用程序域,如果事实并非如此,则将用户再次踢出Safari.

Your example JSON looks fine if substituted with real values for the AppID/AppName. You may want to be specific about what routes you handle but that's up to you - it's a better user experience to only try to handle routes that there's some chance you'll be able to handle, rather than opening your app for every link on your domain and kicking the user out to Safari again if that turns out not to be true.

apple-app-site-association文件不应具有任何文件扩展名,并且应从站点的根目录https://example.com/apple-app-site-association和/或https://example.com/.well-known/apple-app-site-association提供.

The apple-app-site-association file should not have any file extension, and should be served from the root of your site, https://example.com/apple-app-site-association, and/or from https://example.com/.well-known/apple-app-site-association.

您说您支持iOS 9及更高版本-iOS 9.3中进行了更改以检查.well-known路由,该选项首先被选中,因此,如果要在该OS之下支持,则最好将文件放在两个位置.有关详细信息,请参见此答案.

You say you're supporting iOS 9 and above - the change to check the .well-known route, which is checked first, came in iOS 9.3, so if you want to support below that OS, you're best off putting the file in both locations. See this answer for details.

使用正确的MIME类型提供文件也很重要,对于通用链接,它可以用作application/json,并且不需要对其进行签名/加密.如果您不熟悉Web服务器上的配置,则以正确的MIME类型提供服务可能会有些烦人,因为通常服务器会从文件扩展名中确定MIME类型.您不能给它扩展名,因为iOS不会检查带有扩展名的URL,并且(IIRC)重定向是不允许的,因此您也不能这样做.

It's also important that the file is served with the correct MIME-type, for Universal Links it can be served as application/json, and there's no need to sign/encrypt it. Getting it served with the correct MIME-type can be a little annoying if you're not familiar with configuration on your web server, as typically servers will determine the MIME-type from the file extension. You can't give it an extension, as iOS won't check the url with an extension and (IIRC) redirects are not allowed so you can't fake it by doing that either.

所以这是您要完成的任务的摘要,但是如何执行取决于您使用的Web服务器.对于可能是IIS的ASP应用,在这种情况下,此问题和它的答案可以帮助您正确配置Web服务器.如何将文件上传到该服务器的根目录的详细信息在很大程度上取决于您如何配置它.

So that's a summary of what you're trying to accomplish, but how you do that depends on the web server you're using. For an ASP app that's likely to be IIS, in which case this question and its answers may help you configure your web server correctly. The details of how you upload a file to the root of that server will very much depend on how you've configured it as well.

这篇关于配置apple-app-site-association文件并在服务器上上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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