'Firebase Deep Link Web URL query is empty - iOS

I have a problem receiving Firebase Dynamic Links with the new custom URLs. I created one "abc0.page.link", I set up everything to create it in code from the app.

But when receiving, I get this message in LOG:

[Firebase/Analytics][I-ACS023000] Deep Link Web URL query is empty

Nothing happens, and handled is false.

- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
 restorationHandler:
 #if defined(__IPHONE_12_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0)
(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> *_Nullable))restorationHandler {
#else
    (nonnull void (^)(NSArray *_Nullable))restorationHandler {
#endif  // __IPHONE_12_0
 //(void (^)(NSArray *))restorationHandler {

    NSLog(@"continueUserActivity called, withUser: %@, useractivity: %@, webpageurl: %@", self.user.uid, userActivity, userActivity.webpageURL);
  calledFromURL = YES;
  BOOL handled = [[FIRDynamicLinks dynamicLinks] handleUniversalLink:userActivity.webpageURL
                                                          completion:^(FIRDynamicLink * _Nullable dynamicLink,
                                                                       NSError * _Nullable error) {
        NSLog(@"continueUserActivity called");
        if (error) {
            NSLog(@"dynamic link error: %@", error.localizedDescription);
animated:YES completion:nil];
            }
            else {
}
}];
return handled;
}

What is the problem here? Thank you in advance!



Solution 1:[1]

I was having the exact same problem regarding Dynamic Links. I was using these lines in my Podfile:

pod 'Firebase/DynamicLinks'
pod 'Firebase/Analytics'

Just like the official Firebase tutorial ordered to.

However, my app still used the pod 'Google/Analytics' pod at the time, which has been deprecated and should be switched over to Firebase Analytics.

This Google analytics pod has a common dependency with the Pods from Firebase (if I recall correctly, "Firebase/Core") but since it's an old, deprecated version, its dependencies are required to be below a certain version. So, even though I hadn't specified a DynamicLinks pod version in my Podfile, the old dependency only allowed it to be up to a certain version, way older than the up-to-date one. I figured this out when I tried to use the self-diagnostic tool [0] as suggested in the documentation, and my code couldn't find the tool.

So the workaround I used was:

  • Remove the Google/Analytics pod from my Podfile. When I did that, and executed pod update, all Firebase related pods were on the same version as in CocoaPods website [1] i.e. they were up-to-date.

  • I still wanted to use old Google Analytics for a while, since I needed the dynamic links to be working faster than it would take to switch to Firebase Analytics, so I imported manually the static libraries for Google Analytics (libGoogleAnalytics.a) and its headers. It worked just fine then. Since it's not in Podfile anymore, I won't automatically obtain changes, however, I don't think that will be an issue with a deprecated Pod.

If your problem was indeed related to this, I don't think this is the suggested solution. You should use Firebase Analytics ASAP since Google Analytics for mobile will be shut down by October this year.

My guess is that the Firebase functions used to have different ways of parsing and translating dynamic links that aren't compatible with the links made by console today, so it returns an empty URL query.

[0]- https://firebase.google.com/docs/dynamic-links/debug

[1]- https://cocoapods.org/

Solution 2:[2]

You have to set the FirebaseDynamicLinksCustomDomains in the info.plist

https://firebase.google.com/docs/dynamic-links/custom-domains

Solution 3:[3]

Add these lines to your Info.plist and make sure URL must be without the prefex .For example your url is https://example.com/profile then you should use https://example.com

<key>FirebaseDynamicLinksCustomDomains</key>
    <array>
      <string>https://example.com</string>
    </array>

https://blog.devgenius.io/firebase-flutter-dynamic-links-step-by-step-guide-630402ee729b

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Naslausky
Solution 2 Tejero Lucas
Solution 3