Custom Parameters are always Null | Firebase Dynamic Links

Viewed 158

What I Want to Do

When the user taps the URL, it launches the app and pops up a page within the app based on the included custom parameters.

Problem

I succeeded in launching an Android or iOS app by tapping the URL, but the custom parameter is always null.

What I Did

The URL that users tap is as follows.

https://example.page.link/test/?link=https://test.example.com/?id=${id}&apn=com.example.app

id is custom parameter that I want to get when this URL is called.

I created link on Firebase Console like example.page.link/test.

In initState, call initDeepLinks function.

// openPage opens detail page with id
Future<void> initDeepLinks() async {
  final PendingDynamicLinkData? initialLink =
      await FirebaseDynamicLinks.instance.getInitialLink();
  if (initialLink != null) {
    final Uri deepLink = initialLink.link;
    print("A: " + deepLink.queryParameters["id"]!);
    openPage(deepLink.queryParameters["id"]!);
  }

  FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) {
    print("B: " + dynamicLinkData.link.queryParameters["id"]!);
    openPage(dynamicLinkData.link.queryParameters["id"]!);
  }).onError((error) {});
}

But those two print()s print only A: or B: . I checked URL that contains ?id=$id and it is correct.

Tried other URL

When I change the URL to

https://example.page.link/?link=https://test.example.com/?id=${id}&apn=com.example.app
(removed `/test` path)

It works with custom parameters only on Android. But do same on iOS, the browser shows https://test.example.com page and app doesn't appear.


What should I do to make custom parameters?

0 Answers
Related