Dynamic link object has no url

前端 未结 2 1421
不知归路
不知归路 2021-01-07 05:21

I created the DynamicLink for my firebase project when I am trying to receive the link I am getting \"That\'s weird. My dynamic link object has no url\".

fun         


        
2条回答
  •  迷失自我
    2021-01-07 06:09

    After checking all the blogs and posted this issue on firebase, I didn't find any solution for this but I came up with this concrete solution and it will work definitely


    here: dynamicLinkURL is your main dynamic link and shortHandURL is your deeplink URL which is associated with your dynamic link. I hope the below snippet will help you.


    func dynamicLinkhandler(_ dynamicLinkURL: URL, onCompletion: @escaping(_ success: Bool) -> Void) {
        URLSession.shared.dataTask(with: dynamicLinkURL) { (data, response, error) in
            guard error == nil else {
                print("Found Error \(String(describing: error?.localizedDescription)))")
                return
            }
            guard let shortHandURL = response?.url, shortHandURL != dynamicLinkURL else {
                print("Thats Weird, my dynamic link has no URL")
                onCompletion(false)
                return
            }
            onCompletion(true)
        }.resume()
    }
    

提交回复
热议问题