NuGet package that implementing Android In-App Updates for MAUI with debugging capabilities.
- Add NuGet package to your project:
<PackageReference Include="Oscore.Maui.Android.InAppUpdates" Version="1.0.0" />
- Add the following to your
MauiProgram.cs
CreateMauiApp
method:
builder
.UseMauiApp<App>()
+ .UseAndroidInAppUpdates()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
There is no need to specify conditional compilation here, the package provides an empty method for non netx.0-android platforms as a stub to make integration as simple as possible.
It will display a window when starting an application or resume according to the official guides.
You cannot see the popup dialog while developing or if you distribute it manually.
As you can see here,
you have to download the app from the Play Store to see the popup.
I recommend using Android Play Store's “Internal App Sharing” feature to test.
When flexible updates were available in version 1.0.5, the default behavior was:
- If priority 1-3 is specified, flexible update will be offered
- If priority 4-5 is specified, immediate update will be offered
Currently for version 1.1.0 only immediate update is offered, regardless of priority, but there are plans to return the old behavior when it becomes possible
- Right now the package uses the
Xamarin.Google.Android.Play.App.Update
package, but it's not possible to do flexible updates with it.
- https://developer.android.com/guide/playcore/in-app-updates/kotlin-java
- https://github.com/PatGet/XamarinPlayCoreUpdater
- xamarin/GooglePlayServicesComponents#796
- PatGet/XamarinPlayCoreUpdater#22
- PatGet/XamarinPlayCoreUpdater#17
- PatGet/XamarinPlayCoreUpdater#20 (comment)
- https://stackoverflow.com/questions/56218160/how-to-implement-google-play-in-app-update-and-use-play-core-library-with-xamari