jonasbark / flutter_in_app_update

Flutter Plugin: Enables In App Updates on Android using the official Android APIs.
Other
323 stars 79 forks source link

Update dialog not showing in version 4.2.2 #113

Closed RomilPipaliya closed 11 months ago

RomilPipaliya commented 1 year ago

Update dialog not showing in version 4.2.2

I'm showing update dialog after calling this functions > InAppUpdate.completeFlexibleUpdate()

jonasbark commented 1 year ago

What is that supposed to mean? When did it last work? Did you fully read and follow the readme?

RomilPipaliya commented 1 year ago

What is that supposed to mean? When did it last work? Did you fully read and follow the readme?

May be yes, I have also previous version implemented code of your plugin and its work fine. But after Updating the plugin from in_app_update: ^3.0.0 to in_app_update: ^4.2.2 Its not working as well working before update.

Check the Code


  Future<void> checkForUpdate() async {
    InAppUpdate.checkForUpdate().then((info) {
      setState(() {
        _updateInfo = info;
      });
    }).whenComplete(() {
      if (_updateInfo!.flexibleUpdateAllowed) {
        InAppUpdate.startFlexibleUpdate().then((_) {}).whenComplete(() {
          InAppUpdate.completeFlexibleUpdate().then((_) {
            showCupertinoDialog(
              barrierDismissible: false,
              context: context,
              builder: (context) => CupertinoAlertDialog(
                title: Text("Update Finish"),
                content: Text("Please restart the app to load new content"),
                actions: [
                  CupertinoActionSheetAction(
                    child: Text(
                      AppTranslations.of(context)!.text("btn_ok"),
                    ),
                    onPressed: () {
                      Navigator.pushAndRemoveUntil(
                          context,
                          MaterialPageRoute(
                              builder: (context) => SplashScreen()),
                          (route) => false);
                    },
                  ),
                ],
              ),
            );
          });
        });
      }
    }).catchError((e) {
      print(e.toString());
      // showSnack(e.toString());
    });
  }

May be some issue with InAppUpdate.completeFlexibleUpdate()

jonasbark commented 1 year ago

And what does "not work" mean exactly?

RomilPipaliya commented 1 year ago

And what does "not work" mean exactly?

InAppUpdate.completeFlexibleUpdate()

your completeFlexibleUpdate() function is not working cause of Android minimum SDK version is 16 and Playstore compulsory required is 21

jonasbark commented 1 year ago

I don't have a clue what this has to do with anything. Please provide proper information and sources.

RomilPipaliya commented 1 year ago

I don't have a clue what this has to do with anything. Please provide proper information and sources.

Check this path

https://github.com/jonasbark/flutter_in_app_update/blob/master/android/build.gradle where

defaultConfig { minSdkVersion 16 }

Change minSdkVersion from 16 to 21 and Run your example code

jonasbark commented 1 year ago

Yes, it's true that in app updates are only available from 21 upwards. I will adjust the readme accordingly but I still do not understand your point.

You are complaining that the plugin doesn't work on old Android versions?

RomilPipaliya commented 1 year ago

Yes, it's true that in app updates are only available from 21 upwards. I will adjust the readme accordingly but I still do not understand your point.

You are complaining that the plugin doesn't work on old Android versions?

It's not just about old Android versions, not working on any version and issue is only minSdkVersion is 16

try to change, test the plugin and upload new version of it.

jonasbark commented 1 year ago

Did you try to change it and uploaded a new version? It really makes zero sense.

RomilPipaliya commented 1 year ago

Did you try to change it and uploaded a new version? It really makes zero sense.

I just download your source code and make changes as i need and use it I'm just want to inform about the issue now decision is yours you want to fix it leave it whatever it is.

ProZhar commented 11 months ago

The same problem but with a fatal crash link

RomilPipaliya commented 11 months ago

The same problem but with a fatal crash link

just download source code and make changes as you need and use it

jonasbark commented 11 months ago

It works fine like this with all of our production apps, so I'm closing this.