DynamicLink receiving nil does not contain valid required param

Viewed 27

My issue is only on iOS, Android is having no problem receiving the dynamic link

Dynamiclink is nil and when it isn't query params are not there

Firebase Setup short link: https://examplebase.page.link/migration dynamic link: https://www.examplelink.com/migrate I've followed every video in firebase dynamic links documentation

long link I'm trying to use

https://examplebase.page.link/?link=https://www.examplelink.com/migrate?migrationToken=123&docNumber=123&apn=py.com.exam.hoc.debug&isi=11223344&ibi=py.com.exam.development

Before using the dynamic link I encode the deep link to look like this

https://examplebase.page.link/?link=https%3A%2F%2Fwww%2Eexamplelink%2Ecom%2Fmigrate%3FmigrationToken%3D123%26docNumber%3D123&apn=py.com.exam.hoc.debug&isi=11223344&ibi=py.com.exam.development

Where I process the dynamic link

    func application(_ application: UIApplication, continue userActivity: NSUserActivity,
                     restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
        let handled = DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { dynamiclink, error in
            if let migrationToken = dynamiclink?.url?.valueOf("migrationToken"),
               let documentNumber = dynamiclink?.url?.valueOf("docNumber") {
                if !migrationToken.isEmpty && !documentNumber.isEmpty {
                    //do stuff
                } else {
                    // error
                }
            } else {
                // error
            }
        }    
        return handled
    }

Something to point out my short link has the path variable /migration I'm currently not using that in my long link, but if I do, the dynamic link works differently

Case 1 Using base link without the path variable

Inside this method DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { dynamiclink, error in } dynamiclink is nil even though userActivity.webpageURL! has the value of the link received. Error received

Deep Link does not contain valid required params. URL params: { apn = "py.com.exam.hoc.debug"; efr = 1; ibi = "py.com.exam.development"; isi = 1505794177; link = "https://www.examplelink.com/migrate?migrationToken=95e7f2f9-178f-4533-8907-50b656757695&docNumber=4233512"; }

Case 2 Using base link with path variable Inside this method DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { dynamiclink, error in } dynamiclink has the value of https://www.examplelink.com/migrate without the query param In console I see same error than in Case 1

Following one tutorial from Firecast the guy says to set the dynamic link on firebase with the query params set, then my Firebase setup would look like this Firebase Setup dynamic link: https://www.examplelink.com/migrate?migrationToken=123&docNumber=123

The issue here is that the app receives those params hard coded, they are never replaced

0 Answers
Related