Compatible nuget package for GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable in MAUI

Mane, PRASHANT GORAKH 96 Reputation points
2023-03-20T11:20:17.6466667+00:00

In MAUI, I'm trying to check if GooglePlayStore Is Installed or not in device before redirecting to GooglePlayStore through url
but unable to find the package for below code.
Here's the sample code that I'm using

private bool TestIfGooglePlayServicesIsInstalled()
        {
            int queryResult = GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(this);

            if (queryResult == ConnectionResult.Success)
            {
                return true;
            }

            if (GoogleApiAvailability.Instance.IsUserResolvableError(queryResult))
            {
                string errorString = GoogleApiAvailability.Instance.GetErrorString(queryResult);
            }

            return false;
        }
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,932 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 36,231 Reputation points Microsoft Vendor
    2023-03-21T02:01:59.7233333+00:00

    Hello,

    If you want to use the Google ApiAvailability class, it is needed to install Xamarin.GooglePlayServices.Base Nuget Package. For detailed steps and usage, please refer to the following document:

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments