Skip to content

Allows you to check the information in App stores(for example the latest published version) and suggest actions to the user based on this.

License

Notifications You must be signed in to change notification settings

oscoreio/Maui.AppStoreInfo

Repository files navigation

Maui.AppStoreInfo

Nuget package CI/CD License: MIT

Allows you to check the information in App stores(for example the latest published version) and suggest actions to the user based on this.

Usage

  • Add NuGet package to your project:
<PackageReference Include="Oscore.Maui.AppStoreInfo" Version="1.0.0" />
  • Add the following to your MauiProgram.cs CreateMauiApp method:
builder
    .UseMauiApp<App>()
+   .UseAppStoreInfo(options =>
+   {
+       options.CountryCode = "gb"; // Optional, default is "us"
+       options.PackageName = "com.companyname.appname"; // Optional, default is AppInfo.Current.PackageName
+       options.CurrentVersion = new Version(1, 0, 0); // Optional, default is AppInfo.Current.Version
+   })
    .ConfigureFonts(fonts =>
    {
        fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
        fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
    });
  • Use the AppStoreInfo.Current class or IAppStoreInfo from DI to check the latest version and suggest actions to the user:
if (!await AppStoreInfo.Current.IsUsingLatestVersionAsync())
{
    await AppStoreInfo.Current.OpenApplicationInStoreAsync();
}

// This is all based on the information provided by the following method
var information = await AppStoreInfo.Current.GetInformationAsync();
            
await DisplayAlert(
    "App Store Information",
    $"Title: {information.Title}\n" +
    $"Description: {information.Description}\n" +
    $"Latest Version: {information.LatestVersion}\n" +
    $"External Store Uri: {information.ExternalStoreUri}\n" +
    $"Internal Store Uri: {information.InternalStoreUri}\n" +
    $"Release Notes: {information.ReleaseNotes}\n" +
    $"Application Size: {information.ApplicationSizeInBytes/1024/1024} MB\n",
    "OK");

Notes

  • Since Android doesn't provide an official API, there is no support for this other than opening a store page. It is recommended to use Android In-App Updates if you need to check for updates.

Links

About

Allows you to check the information in App stores(for example the latest published version) and suggest actions to the user based on this.

Topics

Resources

License

Stars

Watchers

Forks

Languages