Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Dynamic Links giving error when clicking on long link: Deep Link does not contain valid required params #774

Closed
sindhu238 opened this issue Aug 13, 2019 · 8 comments
Assignees

Comments

@sindhu238
Copy link

sindhu238 commented Aug 13, 2019

I have created dynamic links in firebase console and copy pasted long link to the email.
But when I click on the link I get this error:
Error Message:
Deep Link does not contain valid required params. URL params: {
apn = "com.app.android.xxx.xyz";
ibi = "com.xxx.xyz";
isi = 14xxxxxxx;
link = "https://www.xxx.com/en/account/sign-in";
}

Here is the link that i am clicking on:
https://app.xxx.com/deeplink/?link=https://www.xxx.com/en/account/sign-in&apn=com.app.xxx.xyz.etx&isi=14xxxxxxx&ibi=com.xxx.xyz

Here is how I have setup for the dynamic links:
Screenshot 2019-08-13 at 13 35 16

Screenshot 2019-08-13 at 13 35 35

In AppDelegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseOptions.defaultOptions()?.deepLinkURLScheme = "applinks:app.xxx.com"
        FirebaseApp.configure()

}

And when i click on the deeplink: This function gets called:

 func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
        let handled = DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { dynamiclink, error in
            print("dyn:: ------- \(dynamiclink?.url)")
        }

        return handled
    }

But handled will always return false and I see this error message in the console:
Deep Link does not contain valid required params

@ToddKerpelman
Copy link

ToddKerpelman commented Aug 13, 2019

Have you tried some of the suggestions at https://firebase.google.com/docs/dynamic-links/debug (specifically, looking at the preview page and running the self-diagnostic tool)?

@sindhu238
Copy link
Author

sindhu238 commented Aug 14, 2019

@ToddKerpelman ,
Thanks for helping me debug. I could see this error when i try using the self-diagnostic tool:
---- Firebase Dynamic Links diagnostic output start ----
Firebase Dynamic Links framework version 4.0.1
System information: OS iOS, OS version 11.4, model iPhone
Current date 2019-08-14 10:23:26 +0000
Device locale en-GB (raw en_GB), timezone Europe/London
ERROR: Specified custom URL scheme is (null) but Info.plist do not contain such scheme in CFBundleURLTypes key.
AppID Prefix: 8Wxxxxxxx, Team ID: 8WxxxxxxxL, AppId Prefix equal to Team ID: YES
performDiagnostic detected 1 ERRORS.
---- Firebase Dynamic Links diagnostic output end ----

But In AppDelegate I had this:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseOptions.defaultOptions()?.deepLinkURLScheme = "com.xxx.xyz"
        FirebaseApp.configure()
}

In Info.plist:
Screenshot 2019-08-14 at 11 28 19

I have having the same custom url scheme in both Info.plist and AppDelegate.
Is there some thing else I am missing?

BTW, I am using default url scheme, which is the bundle identifier

Thanks

@ToddKerpelman
Copy link

ToddKerpelman commented Aug 16, 2019

Hmm... well, a few things I noticed reviewing this thread:

  1. If your default customer URL scheme is just the reversed bundle ID, you don't need to specify one at all. I would just stop trying to specify or define it, since that tends to do more harm than good.

  2. I noticed in your earlier code, you had your deepLinkURLScheme as "applinks:com.xxx.xyz". If that was still the case, that "applinks" bit of your string might be messing it up.

  3. (Most importantly) This might not actually be a problem at all, assuming your dynamic link is working the way it's supposed to. I found out that error is generated by the Analytics library, and it's basically telling you that it can't generate a proper campaign measurement from your Deep Link. Which, honestly, is probably working as intended, since you're not adding utm_ parameters to your link. I'm gonna see maybe if we can change that debug info, though, so it doesn't confuse people who run into it and think the entire link is bad.

That said, it's really hard to debug this with fake links and domains. (Particularly when they redirect you to porn sites.) Since this doesn't seem to be a problem with the quickstart, can I suggest that if you have any follow-up issues, that you send them directly to support so they can debug your real links?

Based on that, I'm going to close this issue for now, but please contact support if there are other issues.

@danieil
Copy link

danieil commented Mar 4, 2020

I have created dynamic links in firebase console and copy pasted long link to the email.
But when I click on the link I get this error:
Error Message:
Deep Link does not contain valid required params. URL params: {
apn = "com.app.android.xxx.xyz";
ibi = "com.xxx.xyz";
isi = 14xxxxxxx;
link = "https://www.xxx.com/en/account/sign-in";
}

Here is the link that i am clicking on:
https://app.xxx.com/deeplink/?link=https://www.xxx.com/en/account/sign-in&apn=com.app.xxx.xyz.etx&isi=14xxxxxxx&ibi=com.xxx.xyz

Here is how I have setup for the dynamic links:
Screenshot 2019-08-13 at 13 35 16

Screenshot 2019-08-13 at 13 35 35

In AppDelegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseOptions.defaultOptions()?.deepLinkURLScheme = "applinks:app.xxx.com"
        FirebaseApp.configure()

}

And when i click on the deeplink: This function gets called:

 func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
        let handled = DynamicLinks.dynamicLinks().handleUniversalLink(userActivity.webpageURL!) { dynamiclink, error in
            print("dyn:: ------- \(dynamiclink?.url)")
        }

        return handled
    }

But handled will always return false and I see this error message in the console:
Deep Link does not contain valid required params

FirebaseOptions.defaultOptions()?.deepLinkURLScheme = "applinks:app.xxx.com"
This should be written as follows
FirebaseOptions.defaultOptions()?.deepLinkURLScheme = "com.xxx.xyz"

@hardikamal
Copy link

@sindhu238 Were you able to resolve the issue?
@ToddKerpelman I am also facing the same issue.

@varunwani22
Copy link

varunwani22 commented Dec 13, 2021

@sindhu238
@ToddKerpelman
Facing same issues as well
Please provide any valid solution

@mockturtl
Copy link

mockturtl commented May 11, 2022

@ToddKerpelman #774 (comment)

This might not actually be a problem at all, assuming your dynamic link is working the way it's supposed to. I found out that error is generated by the Analytics library, and it's basically telling you that it can't generate a proper campaign measurement from your Deep Link. Which, honestly, is probably working as intended, since you're not adding utm_ parameters to your link. I'm gonna see maybe if we can change that debug info, though, so it doesn't confuse people who run into it and think the entire link is bad.

Did you ever get a chance to make this change?

I'm hopeful I've finally sewn up the loose ends to get our campaigns working -- on round 5 of "guess we'll just see whether it works in prod." I think it would have spared me much grief if the debug output said what you explained. (Compare: "Something is missing, 🤷. Did Firebase get the event? Tune in tomorrow!")

Other doc suggestions, according to my current understanding of what I've missed:

  • Will my users need to grant IDFA/tracking permission for me to see iOS conversions in the Ads dashboard, or not?
  • Given getInitialLink() != null, can I know whether this is a new install for a unique user (vs. merely "terminated state")?
    • As a business, we want to optimize ad campaigns for the former case, and analyze those UTM parameters separately.
  • TestFlight and the ifl param
  • Does it matter if my marketing uses the "Short" vs "Long" link shown in Link Details?
  • percent-encoding the link param

@speshiy
Copy link

speshiy commented May 24, 2022

Hi!
I'm using Ionic and faced the same problem.
I just ADD ifl param into url and it works

https://url.page.link/?link=https://open.url.com?promocode=PEt0wzqwcx&apn=com.app.app&isi=123456&ibi=com.app.app&ifl=https://url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants