Search code examples
flutterfirebasefirebase-dynamic-linkssocial-media

Flutter firebase dynamic link social tags info not showing at all


I have the below code which does generate the dynamic link correctly. However, when I share the link using Share plugin I just see the link text. Nothing else appears in the shared message. None of the social tags attributes are shown when the link is shared.

Second thing, the link also does not open in the browser - it always tries to find the app on google play store. My app isn't on the play store yet and I want it to always point to browser. The dynamic link I configured on playsore does open in the browser but the links created via code go to the play store - always. The DL I configured also does NOT show any social media info.

      final DynamicLinkParameters parameters = DynamicLinkParameters(
        uriPrefix: 'https://zakaas.page.link',
        link: Uri.parse("https://firebasestorage.googleapis.com/v0/b/removed_strage/o/UserVideos%2F2020-06-21%2017%3A42%3A54.530730.mp4?alt=media&token=removed_token_value"),
        androidParameters: AndroidParameters(
          packageName: 'com.clidio.zakaas',
          minimumVersion: 21,
        ),
        navigationInfoParameters: NavigationInfoParameters(
          forcedRedirectEnabled: false,
        ),
        dynamicLinkParametersOptions: DynamicLinkParametersOptions(
          shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short,
        ),
        socialMetaTagParameters: SocialMetaTagParameters(
          title: 'Example of a Dynamic Link',
          description: 'This link works whether app is installed or not!',
        ),
      );
      final Uri dynamicUrl = await parameters.buildUrl();
      final ShortDynamicLink shortenedLink = await DynamicLinkParameters.shortenUrl(
        dynamicUrl,
        DynamicLinkParametersOptions(shortDynamicLinkPathLength: ShortDynamicLinkPathLength.unguessable),
      );
      Share.share('${shortenedLink.shortUrl}', subject: '${shortenedLink.shortUrl}');

Solution

  • OK. After a simple thought, I got this working now. I used a social app "HIKE" when I was testing and unfrtunately it did not work on hike. I don't use whatsapp for >2 years now but then I gave a try on friend's whatsapp and it did work . It shows image as well.

    Thank you