Easily detect if you are running the latest version of your iOS, macOS, Android, or Windows app and open it in the App Store, Play Store, or Microsoft Store to update it.
Platform | Supported | Version |
---|---|---|
Xamarin.iOS | Yes | 7.0+ |
Xamarin.Android | Yes | 10.0+ |
Xamarin.Mac | Yes | 10.7+ |
Windows (UWP) | Yes | 10.0+ (Target 14393+) |
Check if the current running app is the latest version available in the public store:
bool isLatest = await CrossLatestVersion.Current.IsUsingLatestVersion();
Get the version number of the current running app's latest version available in the public store:
string latestVersionNumber = await CrossLatestVersion.Current.GetLatestVersionNumber();
Get the version number of the current app's installed version:
string installedVersionNumber = CrossLatestVersion.Current.InstalledVersionNumber;
Open the current running app in the public store:
await CrossLatestVersion.Current.OpenAppInStore();
Set the country code to be used when looking up the current app in the public store:
CrossLatestVersion.Current.CountryCode = "nz";
Notes about the CountryCode
property:
using Plugin.LatestVersion;
var isLatest = await CrossLatestVersion.Current.IsUsingLatestVersion();
if (!isLatest)
{
var update = await DisplayAlert("New Version", "There is a new version of this app available. Would you like to update now?", "Yes", "No");
if (update)
{
await CrossLatestVersion.Current.OpenAppInStore();
}
}
Licensed under MIT. See License file