Firebase Dynamic Links on iMessage Displaying Additional Text (Flutter)

Viewed 224

I'm currently incorporating Firebase Dynamic Links in Flutter to allow users to send training plans to one another. I shorten the URL before sending and the flow works as expected on most apps/messaging. However, on iMessage specifically, the sent message is pasting additional text. Would love any help on getting to the root of this problem!

final DynamicLinkParameters parameters = DynamicLinkParameters(
  // This should match firebase but without the username query param
  uriPrefix: 'https://trainsolosoccer.page.link',
  // This can be whatever you want for the uri, https://yourapp.com/groupinvite?username=$userName
  link: Uri.parse(
      'https://trainsolotest.page.link/planId?planId=$planId&userId=$userId&planName=$planName'),
  androidParameters: AndroidParameters(
    packageName: 'com.trainsolo',
    minimumVersion: 1,
  ),
  iosParameters: IosParameters(
    bundleId: 'com.trainsolo',
    minimumVersion: '1',
    appStoreId: appStoreId,
  ),
  socialMetaTagParameters: SocialMetaTagParameters(
      title: '${username} has shared a training plan with you!',
      description:
          "Please download the Trainsolo app to access ${username}'s plan along with hundreds of other drills ...",
      imageUrl: Uri.parse(
          "https://static.wixstatic.com/media/30d704_86712894e6964d56a397977a37080252~mv2.jpg")),
);
final ShortDynamicLink shortDynamicLink = await parameters.buildShortLink();
final Uri link = shortDynamicLink.shortUrl;
// Flutter package: https://pub.dev/packages/share
Share.share(link)

enter image description here

1 Answers

Not sure but searching in different places gave me some suggestions. Wring it here so you can try them.

Option 1. Try FirebaseDynamicLinks's build short link

final unguessableDynamicLink = await FirebaseDynamicLinks.instance.buildShortLink(
    dynamicLinkParams,
    shortLinkType: ShortDynamicLinkType.unguessable,
);

Option 2. Add a space Or some prefix text before the link and share that string.

Related