简体   繁体   English

iOS 具有二级子域的通用链接不会深度链接到本机应用程序,但在一级子域(同一主机)上的深度链接很好

[英]iOS Universal Link with a second level subdomain doesn't deep-link to native app, but deep-links fine on a first-level subdomain (same host)

I have capabilities in my app that contain multiple applinks: entries like so:我的应用中有包含多个应用链接的功能:条目如下:

applinks:firstlevel.domain.com
applinks:second.level.domain.com

Universal links on the first level subdomain work fine and open the app.第一级子域上的通用链接可以正常工作并打开应用程序。 Universal links on the second level subdomain do NOT open the app (go to safari).二级子域上的通用链接不会打开应用程序(转到 safari)。 My suspicion right now is because of the composite (2-piece) subdomain.我现在的怀疑是因为复合(2 件)子域。

The apple-app-site-association files are completely identical on both , and are hosted and downloadable from both. apple-app-site-association 文件在两者上完全相同,并且可以从两者托管和下载。 Both URLs are hittable from our internal network and are on the same domain and TLD.这两个 URL 都可以从我们的内部网络中访问,并且位于相同的域和 TLD 上。 SSL is configured correctly. SSL 配置正确。 There are no redirects taking place (verified through chrome dev tools)没有发生重定向(通过 chrome 开发工具验证)

Each respective apple-app-site-association file is hosted under appropriate subdomain (not on the root of domain.com).每个相应的 apple-app-site-association文件都托管在适当的子域(而不是 domain.com 的根目录)下。 But the same top level domain is used for both subdomains in URL 1 and 2 .但是相同的顶级域用于 URL 1 和 2 中的两个子域

Can the second-level subdomain be the problem, or is it more likely that other network configuration differences are the problem?二级子域可能是问题,还是其他网络配置差异更可能是问题? I couldn't find information online that states whether multiple subdomains are supported for universal links or not.我在网上找不到说明通用链接是否支持多个子域的信息。

UPDATE: Tried removing the applinks:firstlevel.domain.com entry, to make sure the two subdomains aren't conflicting for the same bundle ID (and the site association).更新:尝试删除 applinks:firstlevel.domain.com 条目,以确保两个子域不会因相同的捆绑 ID(和站点关联)而发生冲突。 This did not make a difference.这并没有什么不同。 The second level subdomain still doesn't deep-link.二级子域仍然没有深度链接。

Any suggestions on how to diagnose why the second URL can not be opened as a deeplink in the app?关于如何诊断为什么第二个 URL 无法在应用程序中作为深层链接打开的任何建议?

It's also not appropriate to use wildcards or upload the apple-app-site-association file to the root of the domain, because that's production, and should not have any lower environment settings on it.也不适合使用通配符或将 apple-app-site-association 文件上传到域的根目录,因为那是生产环境,不应有任何较低的环境设置。

Here's our apple-app-site-association file:这是我们的 apple-app-site-association 文件:

{
    'webcredentials': {
        'apps': ['ourteamid.ca.ourdomain.ourname']
    },
    'applinks': {
        'apps': [],
        'details': [{
            'appID': 'ourteamid.com.ourdomain.ourname1.ourname2',
            'paths': ['r/samplepath/*', 'en/r/samplepath/*', 
'fr/r/samplepath/*']
        }]
    }
}

OK, found the solution.好的,找到了解决方案。 It was the single quotes in the apple-app-site-association file (single quotes are not valid JSON).它是 apple-app-site-association 文件中的单引号(单引号不是有效的 JSON)。 Apple's examples all use double quotes. Apple 的示例都使用双引号。

At some point, someone converted it to single quotes, and uploaded the file, and we did not catch it.在某个时候,有人将其转换为单引号,并上传了文件,但我们没有抓住它。 The deeplinks work fine with double quotes in the file, and it had nothing to do with a second level domain.深度链接在文件中使用双引号时可以正常工作,并且与二级域无关。

Updated association file:更新的关联文件:

    {
    "webcredentials": {
        "apps": ["ourteamid.ca.ourdomain.ourname"]
    },
    "applinks": {
        "apps": [],
        "details": [{
            "appID": "ourteamid.com.ourdomain.ourname1.ourname2",
            "paths": ["r/samplepath/*", "en/r/samplepath/*", "fr/r/samplepath/*"]
        }]
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SwiftUI:如何在导航视图中“深度链接”到列表的第二/第三级 - SwiftUI: How to “deep-link” to the second/third level of a list in a navigation view 带有深层链接的元数据无法在android和ios上打开我的应用 - metadata with deep-links to open my app on android and ios doesn't work 如何直接在iOS上的Okta Mobile中深度链接到应用程序 - How to deep-link directly to an app in Okta Mobile on iOS 如果您在iOS或Android上将其深层链接到未安装的应用程序,会发生什么情况? - What happens if you deep-link on iOS or Android into an app you don't have installed? 是否可以使用来自电子邮件的通用链接(深层链接)启动 iOS 应用程序 - iOS - Is it possible to launch an iOS app using Universal Links (deep link) from Email - iOS iOS深层链接和Universal链接,如何在ios中进行深层链接 - iOS Deep linking and Universal link, how to deep link in ios 直接深层链接到特定的聊天或消息? - Deep-link directly into a specific chat or message? Firebase:-待处理的深层链接无法正常工作 - Firebase :- Pending Deep-link is not working 鉴于与实时Feed流的深层链接,如何在iOS中的应用中显示此直播? - Given a deep-link to a live-feed stream, how can I display this livestream within my app in iOS? iOS可以支持HTTP方案中的深层链接吗? - Can iOS Support Deep-Links Within the HTTP Scheme?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM