google-playapp-storemauilauncher

.Net Maui Launcher URL for App Store/Google Play


Reading about the launcher it gives the example of starting the Lyft app by doing something like:

await Launcher.Default.OpenAsync("lyft://ridetype?id=lyft_line");

I can't find examples for doing something with the app store or google play store like:

await Launcher.Default.OpenAsync("appStore://app?id=1234567");

Is this even a thing?


Solution

  • Yes. You can try to use Launcher to open another app and determine if the app can be opened by CanOpenAsync method (If not, open Playstore or AppStore, you should know the redirection link to Google Play store or Apple AppStore.)

    For example, you want to launch Microsoft Word with AppStore.

    1.Get the deep link for the Microsoft Word https://apps.apple.com/us/app/microsoft-word/id586447913 via app-store

    2.And then you can launch it via below code:

    bool launcherOpened = await Launcher.Default.TryOpenAsync("https://apps.apple.com/us/app/microsoft-word/id586447913");
    
    if (launcherOpened)
    {
        // Do something fun
    }