5

In my Flutter app I have implemented dynamic linking, I am sending the link with an id parameter and when the app receives it it navigates to the detailed screen with given id. It works all fine in Android, however on iOS long dynamic link is working as expected but when I send short link it gives me this and only opens the app, the handleDynamicLink function not triggered.

FLTFirebaseDynamicLinks: The url has not been supplied with the dynamic link.Please try opening your app with the long dynamic link to see if that works

So I am sending a WhatsApp message with created link and long link is not the thing that I want to send.

My dynamic link initializing code

void dynamicLinkInit() async {
    final PendingDynamicLinkData? initialLink = await FirebaseDynamicLinks.instance.getInitialLink();
    if (initialLink != null) {
      handleDynamicLink(initialLink);
    }
    FirebaseDynamicLinks.instance.onLink.listen((PendingDynamicLinkData dynamicLink) async {
      handleDynamicLink(dynamicLink);
    }).onError((e) => l.w(e));

  }

  void handleDynamicLink(PendingDynamicLinkData dynamicLink) {
    final Uri uri = dynamicLink.link;
    l.w(uri);
    final queryParams = uri.queryParameters;
    if (queryParams.isNotEmpty && queryParams['id'] != null) {
      String id = queryParams["id"]!;
      l.w(id);
      Get.to(() => RequestDetail(id: id));
    }
  }

I also added the link to Associated Domains and URL Types part.

Do you have any idea why the link is working when it is long but not when it is short?

  • Facing same issue, not able to find root cause of this issue! – Devarsh Ranpara Mar 22 '23 at 05:44
  • A different approach could be using link shorteners on the long link but it is not the thing we wanted. – Yaren Albayrak Mar 22 '23 at 23:11
  • 1
    Hey I found the issue, The issue was from the link generation part. The Backend developer missed iOS bundle id and app store id in the link generation part. It was updated and the app started behaving as expected. – Devarsh Ranpara Mar 24 '23 at 05:29

0 Answers0