How to get version number of application from play store using xamarin forms

Raju Gadda 66 Reputation points
2022-05-28T00:36:11.157+00:00

I need to check current version of Installed Application and Playstore application version. If it is not same app should navigate to Playstore . im using xam.Plugin.LatestVersion(2.1.0) To get the latestversion number of application from play console. unfortunately not getting latest version number of application from play store. The below code im using.

                       private async void ChekAppVersion()
                     {
                     try
                            {
                       latestVersionNumber = await CrossLatestVersion.Current.GetLatestVersionNumber();
                       installedVersionNumber = CrossLatestVersion.Current.InstalledVersionNumber;
                        if (installedVersionNumber != latestVersionNumber)
                     {
                      await DisplayAlert("New Version", "There is a new version of this app available. Please update now?", "Ok");
                          await CrossLatestVersion.Current.OpenAppInStore();
                         ChekAppVersion();

                    }
                 else
                {

                   }
               }
                catch (Exception ex)
               {

             }
            }

Im getting the installedVersionNumber, but im unable to get the latestVersionNumber(Playstore). Please help on this

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,296 questions
{count} votes