want to share specific event linke we share tiktok video and use click on the link and go to that video

Viewed 50
  1. I want to share specific event link we share a tiktok video and click on the link and go to that video. i use the firebase dynamic link package it works but only opens the app not going to a specific screen.
import 'package:get/get.dart';
import 'package:share/share.dart';

class DeepLinkController extends GetxController {
Future inItDynamicLinks() async {
 FirebaseDynamicLinks.instance.onLink(
     onSuccess: (PendingDynamicLinkData? dynamicLink) async {
   final Uri deepLink = dynamicLink!.link;
   print("deeplink found");
   print(deepLink);
   Get.to(deepLink.path);
 }, onError: (OnLinkErrorException e) async {
   print('here is error $e');
 });
 final PendingDynamicLinkData? data =
     await FirebaseDynamicLinks.instance.getInitialLink();
 final Uri? deepLink = data?.link;

 if (deepLink != null) {
   Get.to(deepLink.path);
 }
}

/// create dynamic links
buildDynamicLinks(
   {required String heading,
   required String subHeading,
   required String id}) async {
 var url = 'https://proislam.page.link';
 final DynamicLinkParameters dynamicLinkParameters = DynamicLinkParameters(
   uriPrefix: url,
   link: Uri.parse('$url/$heading'),
   androidParameters: AndroidParameters(
     packageName: 'com.hyxio.islamMuslim.pro',
     minimumVersion: 1,
   ),
   socialMetaTagParameters: SocialMetaTagParameters(
       title: '$heading', description: '$subHeading'),
 );
 final ShortDynamicLink dynamicLink =
     await dynamicLinkParameters.buildShortLink();
 String? desc = '${dynamicLink.shortUrl.toString()}';
 await Share.share(desc, subject: id);
 }
}
0 Answers
Related