Giter Club home page Giter Club logo

maui.android.inappupdates's Introduction

Maui.Android.InAppUpdates

Nuget package CI/CD License: MIT

NuGet package that implementing Android In-App Updates for MAUI with debugging capabilities. Flexible

Usage

  • 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

Notes

  • Right now the package uses the Xamarin.Google.Android.Play.App.Update package, but it's not possible to do flexible updates with it.

Links

maui.android.inappupdates's People

Contributors

havendv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

maui.android.inappupdates's Issues

'MauiAppBuilder' does not contain a definition for 'UseAndroidInAppUpdates'

I installed this as described here: https://github.com/oscoreio/Maui.Android.InAppUpdates?tab=readme-ov-file#usage,
but I have this error:

Error (active)	CS1061	'MauiAppBuilder' does not contain a definition for 'UseAndroidInAppUpdates' and no accessible
extension method 'UseAndroidInAppUpdates' accepting a first argument of type 'MauiAppBuilder' could be found
(are you missing a using directive or an assembly reference?)
nadobi-app (net8.0-android34.0)
C:\Users\filip\git\nadobi-app\MauiProgram.cs	12		

What should I do?

Android 14 not working

Java.Lang.SecurityException: 'app.com.br': One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts'

How it works?

I've installed the nuget package and then I added UseAndroidInAppUpdates
Does it show in app update popup automatically on app startup?
If yes, does it show the popup everytime the user opens the app? Or it follows the update settings of the published version in google play?
If no, then, what else do we need to do?

Issue when used together with MSAL authentication

When there is an app update available, and the update is rejected, this MSAL code throws an exception with "Unknown error"

var authResult = await _publicClientApplication
                .AcquireTokenInteractive(_appSettings.Scopes)
                .WithParentActivityOrWindow(() => Platform.CurrentActivity)
                .ExecuteAsync();

I'm assuming it has something to do with the lifecycle events, since MSAL requires this...

.ConfigureLifecycleEvents(events =>
            {
#if ANDROID
                events.AddAndroid(platform =>
                {
                    // required for MSAL redirect
                    platform.OnActivityResult((activity, rc, result, data) =>
                    {
                        AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(rc, result, data);
                    });
                });
#endif
            })

The same behaviour can be seen using the FakeAppUpdateManager, it basically renders MSAL authentication unusable.

This is using Microsoft.Identity.Client version 4.59.0

I'm targeting iOS too. Do I have to use conditional compilation?

Hi!

First of all, great job!
As this package is specific for Android, do I need to use conditional compilation or, will it be ignored if not running in Android?

        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
#if Android
            .UseAndroidInAppUpdates()
#elif IOS
            .UseAppStoreInfo()
#endif
            .UseUraniumUI()
            .UseUraniumUIMaterial()
            .UseMauiCommunityToolkit()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.