Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dialog not showing in version 4.2.2 #113

Closed
RomilPipaliya opened this issue Oct 10, 2023 · 13 comments
Closed

Update dialog not showing in version 4.2.2 #113

RomilPipaliya opened this issue Oct 10, 2023 · 13 comments

Comments

@RomilPipaliya
Copy link

Update dialog not showing in version 4.2.2

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

@jonasbark
Copy link
Owner

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

@RomilPipaliya
Copy link
Author

RomilPipaliya commented Oct 10, 2023

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
Copy link
Owner

And what does "not work" mean exactly?

@RomilPipaliya
Copy link
Author

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
Copy link
Owner

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

@RomilPipaliya
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

RomilPipaliya commented Oct 11, 2023

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
Copy link
Owner

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

@RomilPipaliya
Copy link
Author

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
Copy link

ProZhar commented Nov 3, 2023

The same problem but with a fatal crash link

@RomilPipaliya
Copy link
Author

The same problem but with a fatal crash link

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

@jonasbark
Copy link
Owner

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

@jonasbark jonasbark closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants