How to navigate to play store if app is not installed?

119 Views Asked by At
  try {
    final initialURI = await getInitialUri();
    if (initialURI != null) {
      debugPrint("Initial URI received $initialURI");
      if (!mounted) {
        return;
      }
      setState(() {
        _initialURI = initialURI;
        print("just checking$_initialURI");
      });
       if (_initialURI!.path == '/doctor') {
    
        pageController.jumpToPage(
          1,
        );
        _bottomNavCubit.updateIndex(1);
        pageController.page == 1;
        currentIndex = 1;
      } 
      else if (_initialURI!.path == '/pricing') {
        Navigator.push(
          context,
          MaterialPageRoute(
              builder: (context) => SubscriptionScreen(
                subscriptionScreenArgs: SubscriptionScreenArgs(
                    isFromInstantConsutation: false),
              )),
        );
        NavigationUtil.pop(context);
      }
    }
    else {
      debugPrint("Null Initial URI received");
    }
  } on PlatformException {
    debugPrint("Failed to receive initial uri");
  } on FormatException catch (err) {
    if (!mounted) {
      return;
    }
    debugPrint('Malformed Initial URI received');
    setState(() => _err = err);
  }
}

***I am using uni_links package in flutter. When someone click on the link it's navigating to the app on particular screen. Now I want to do is that when my app is not installed and some one clicks on the link then it should navigate to Play store on my application. How to do it?

I have also shared my code snippet ***

1

There are 1 best solutions below

0
On

Not sure if you can navigate to Play store with Uni_links however you can by using firebase dynamic links : https://pub.dev/packages/firebase_dynamic_links

https://firebase.google.com/docs/dynamic-links