larryaasen / upgrader

A Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
MIT License
547 stars 268 forks source link

Cannot trigger minAppVersion in iOS Simulator #256

Closed ZahidTekbas closed 1 year ago

ZahidTekbas commented 1 year ago
flutter: upgrader: package info appName: Etesettur
flutter: upgrader: package info version: 2.0.12
flutter: upgrader: countryCode: US
flutter: upgrader: languageCode: tr
flutter: FormatException: Not a properly formatted version string
flutter: upgrader: blocked: false
flutter: upgrader: debugDisplayAlways: false
flutter: upgrader: debugDisplayOnce: false
flutter: upgrader: hasAlerted: false
flutter: upgrader: appStoreVersion: 2.0.12
flutter: upgrader: installedVersion: 2.0.12
flutter: upgrader: minAppVersion: [:mav: 2.0.13]
flutter: upgrader: isUpdateAvailable: false
flutter: upgrader: shouldDisplayUpgrade: false
flutter: upgrader: shouldDisplayReleaseNotes: false
  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      url: "https://pub.dartlang.org"
    source: hosted
    version: "5.0.0"
Upgrader(
        durationUntilAlertAgain: Duration(seconds: 5),
        canDismissDialog: false,
        shouldPopScope: () {
          return false;
        },
        debugLogging: true,
        minAppVersion: "[:mav: 2.0.13]",
        dialogStyle: Platform.isAndroid ? UpgradeDialogStyle.material : UpgradeDialogStyle.cupertino,
        onUpdate: () {
          if (Platform.isAndroid) {
            return false;
          } else if (Platform.isIOS) {
            launchUrl(
              Uri.parse("https://apps.apple.com/us/app/e-tesettür/id1151745907"),
              mode: LaunchMode.externalApplication,
            );
            return true;
          } else {
            return false;
          }
        },
        showIgnore: false,
        showLater: false,
        showReleaseNotes: false,
      ),

I'm trying to force upgrade for user. In order to test that, I set up a minAppVersion (2.0.13) which is not present in App Store yet. Even though setting higher minAppVersion, it does not show any alert for me to upgrade the app.

Is there something wrong in my code?

larryaasen commented 1 year ago

The minAppVersion parameter should be a valid version as a string like this: '2.0.13'.

phamquoctrongnta commented 1 year ago

The minAppVersion parameter should be a valid version as a string like this: '2.0.13'.

image

So what do the settings here mean? Is it necessary to already set the "minAppVersion" value in the Upgrader widget?

larryaasen commented 1 year ago

So what do the settings here mean? Is it necessary to already set the "minAppVersion" value in the Upgrader widget?

No, it is not necessary to use minAppVersion parameter. Just follow the instructions for the description field in the app stores.