iOS Firebase Deeplink无法正常工作

时间:2019-09-10 13:50:24

标签: ios firebase deeplink

我已经在firebase控制台中创建了动态链接,并定义了我的深层链接..

并且我添加了以下代码:

    func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
    if  userActivity.activityType == NSUserActivityTypeBrowsingWeb {
        let url = userActivity.webpageURL
        print("LINK HERE")
        print(url)
        if let incomingURL = userActivity.webpageURL{
            print("incoming link is: \(incomingURL)")
            let linkHandled = DynamicLinks.dynamicLinks().handleUniversalLink(incomingURL){
                (dynamicLink, error) in
                guard error == nil else {
                    print("found error \(error!.localizedDescription)")
                    return
                }
                if let dynamicLink = dynamicLink{
                    self.handleIncomingDynamicDeepLinks(dynamicLink)
                }
            }
            if linkHandled{
                return true
            }
        }

    }

    return true
  }

这里是如何处理它,只是试图打印深层链接...

       func handleIncomingDynamicDeepLinks(_ dynamicLink: DynamicLink){
    guard let url = dynamicLink.url else{
        print("that's werid there's no url")
        return
    }
    print("LINK IS: \(url.absoluteString)")
}

但是得到这个:

  

传入链接为:https://my短链接/ GwKW    5.15.0-[Firebase / Analytics] [I-ACS023000]深度链接Web URL查询为空    -canOpenURL:URL失败:“ cydia://”-错误:“此应用不允许查询方案cydia”

如何解决此错误,这是什么意思?我搜索并尝试了所有答案,但没有一个。

0 个答案:

没有答案