upgrader icon indicating copy to clipboard operation
upgrader copied to clipboard

Forced upgrade should have a different title and text

Open joymyr opened this issue 2 years ago • 3 comments

When setting Minimum App Version the user is still asked kindly if he/she wants to update the app, even though there's no other option. The text should indicate that the user needs to upgrade to continue using the app when that's the case.

joymyr avatar May 05 '22 08:05 joymyr

how to enable force upgrade??

jaskiratAtNexG avatar Jun 09 '22 10:06 jaskiratAtNexG

I wanted the same feature for my app and its solution is very simple. What I did, I added UpgradeAlert in my splash screen. User will be asked to update app on the splash screen and i restricted user to enter in the app. User will have to update app or close app and whenever user will launch app again dialog will pop up.

UpgradeAlert(
      upgrader: Upgrader(
        durationUntilAlertAgain: Duration(seconds: 1),
        dialogStyle: UpgradeDialogStyle.cupertino,
        canDismissDialog: controller.canDismissDialog.value,
        showIgnore: false,
        showLater: false,
        showReleaseNotes: true,
        shouldPopScope: (){
          controller.closeApp();
          return true;
        },
        willDisplayUpgrade: ({String? appStoreVersion,bool? display,String? installedVersion,String? minAppVersion}){
          if(display != null){
            controller.willShowUpgradeDialog = display;
          }
          controller.checkAndNavigateScreen();
        },
        onUpdate: (){
          controller.closeApp();
          return true;
        },
      ),
      child: YourWidget(),
    )

kamran8545 avatar Sep 21 '22 05:09 kamran8545

@kamran8545 That won't show a different title/text depending on if it's a forced or optional upgrade. Actually it seems to not use the force upgrade functionality at all, but instead force the user to upgrade at any new version. Also, the app will close after an update. Instead you should use this https://pub.dev/packages/upgrader#minimum-app-version.

joymyr avatar Dec 06 '22 15:12 joymyr

@joymyr Look at the latest version of this package with a latest customization options. I think it now meets your needs. If not, please open a new issue with your details.

larryaasen avatar Apr 05 '24 12:04 larryaasen