Dynamic link object has no url

前端 未结 2 1423
不知归路
不知归路 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()
    }
    
    0 讨论(0)
  • 2021-01-07 06:15

    Double check that the bundle id you set up in the dynamic link wizard creation within the firebase console it's the one you are running the app into.

    I have three different bundle ids (dev, enterprise, production) and, for instance, if a set in the link the production bundle id but the app runs the dev bundle id, instead of returning back some error it returned an honest dynamicLink object but with a nil value in the url.

    0 讨论(0)
提交回复
热议问题