应用程序无法通过分支深度链接网址启动

时间:2019-09-10 09:22:24

标签: ios swift branch deep-linking ios-universal-links

我正在使用branch.io SDK进行我的应用程序中的深层链接。直到最近,我们的某些iOS应用程序开始表现出非常奇怪的行为,一切都很好。我们为用户创建的分支链接(深层链接)无法在某些具有iOS 12或更高版本的随机设备中启动应用程序。

我已经在服务的服务器上托管了AASA文件(尽管我知道分支机构已经为我们托管了文件)。我已经完成了分支文档中提供的故障排除过程。但是我仍然无法确定问题所在。我还通过AASA验证程序验证了我的网站。

    let buo = BranchUniversalObject(canonicalIdentifier: "content/123")
    buo.canonicalUrl = path
    buo.title = "some title"
    buo.contentDescription = "Some description"
    buo.imageUrl = restaurant.logo

    let blp: BranchLinkProperties = BranchLinkProperties()
    blp.feature = "sharing"
    blp.campaign = "Some random text"
    blp.stage = "new user"

    blp.addControlParam("$ios_url", withValue: path)
    blp.addControlParam(kAPIKey_BranchImageId, withValue: "\(imageId)")
    blp.addControlParam(kAPIKey_BranchStoreId, withValue: "\(restaurant.id)")
    blp.addControlParam("$desktop_url", withValue: path)
    blp.addControlParam("$android_url", withValue: path)
    blp.addControlParam("$blackberry_url", withValue: path)
    blp.addControlParam("$windows_phone_url", withValue: path)

    //Get Branch Short URL & share via UIActivityViewController
    buo.getShortUrl(with: blp) { (shortURL, _) in
        log.debug("Branch short url:\(shortURL ?? "")")
        var shareItems: [Any] = []
        if let shorturl = shortURL {
            shareItems += [shorturl]
        } else {
            shareItems += [path]
        }
    }

一旦我点击分支网址(来自Notes应用程序),它就会打开safari。如果我长按该链接,则不会给出用于在相应应用中打开的选项。当在Safari浏览器中打开链接时,该错误向我显示。错误警报消息->“由于地址无效,Safari无法打开页面”。然后重定向到我各自的网站URL。之后,当我返回到应用程序(手动)时,分支回调应该接收到应该传递的分支链接数据,并且一切正常。因此,我主要担心的是为什么分支链接无法打开应用程序。

0 个答案:

没有答案