ios:通用链接无法在iOS 10上运行

met*_*ors 4 xcode deep-linking ios ios-universal-links

我正在尝试在我的iOS应用中集成通用链接.因此,只要有人点击<myapp>.herokuapp.com/content就会直接重定向到应用程序.我按照指南进行设置.我做了以下设置,但无法使其正常工作.我还检查了stackoverflow上的其他线程,但没有一个解决了这个问题.

  • 在我的应用目标上的功能选项卡中添加了关联域.添加了两个域:activitycontinuation:<myapp>.herokuapp.comapplinks:<myapp>.herokuapp.com.
  • 在Build Phases> Copy Bundle Resources中添加了文件.entitlements.
  • https://developer.apple.com/account/#/membership获得teamId
  • 在我的网站上添加一个路由,apple-app-site-associationhttps://<myapp>.herokuapp.com/apple-app-site-association其返回以下JSON:

    {
        "applinks": {
            "apps": [],
            "details": [
                {
                    "appID": "<teamId>.<bundleId>.dev",
                    "paths": [ "*" ]
                },
                {
                    "appID": "<teamId>.<bundleId>",
                    "paths": [ "*" ]
                }
            ]
        },
        "activitycontinuation": {
            "apps": [
                "<teamId>.<bundleId>.dev",
                "<teamId>.<bundleId>"
            ]
        }
    }
    
    Run Code Online (Sandbox Code Playgroud)
  • 安装了从Xcode到iPhone 6s Plus(物理设备)的应用程序,带有包ID <bundleId>.dev和复制https://<myapp>.herokuapp.com/content到Notes的链接,但它在Safari中打开.

met*_*ors 5

修复了这个问题.问题是我正在使用Debug配置进行测试.当我尝试使用Release版本时,一切正常.