larryaasen / upgrader

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

debugDisplayOnce = true always shows the upgrader dialog even in RELEASE MODE #389

Closed RoberRaf closed 3 months ago

RoberRaf commented 4 months ago

Problem description: if debugDisplayOnce is set to true, an upgrader dialog will always show up even in release mode, even there is no newer version in the store or both versions are the same.

Expected behavior: upgrader dialog only shows in debug mode as long as there is no a newer version.

============================ my code:

Scaffold( body: UpgradeAlert( upgrader: Upgrader( debugDisplayAlways: false, debugDisplayOnce: true, debugLogging: true, durationUntilAlertAgain: const Duration(hours: 2), messages: UpgraderMessages(code: L10n.isAr(context) ? 'ar' : 'en'), willDisplayUpgrade: ( {appStoreVersion, required bool display, installedVersion, minAppVersion}) { if (!display) fetchAndRedirect(); }), dialogStyle: Platform.isAndroid ? UpgradeDialogStyle.material : UpgradeDialogStyle.cupertino, showIgnore: false, canDismissDialog: false, onLater: () { fetchAndRedirect(); return true; }, child: SizedBox(),);

================================== my log :

upgrader: instantiated upgrader: initialize called upgrader: build UpgradeAlert upgrader: initializing upgrader: default operatingSystem: android TE1A.220922.010 upgrader: operatingSystem: android upgrader: isAndroid: true, isIOS: false, isLinux: false, isMacOS: false, isWindows: false, isFuchsia: false, isWeb: false package info packageName: * package info appName: * package info version: 1.1.3 countryCode: US languageCode: en lookupById url: https://play.google.com/store/apps/details?id=&gl=US&hl=en&_cb=1709561649413980 upgrader: need to evaluate version upgrader: blocked: false upgrader: debugDisplayAlways: false upgrader: debugDisplayOnce: false upgrader: hasAlerted: false upgrader: appStoreVersion: 1.1.2 upgrader: installedVersion: 1.1.3 upgrader: minAppVersion: null upgrader: isUpdateAvailable: false upgrader: shouldDisplayUpgrade: false upgrader: shouldDisplayReleaseNotes: shouldDisplayReleaseNotes

=========================================== pubspec.lock

upgrader: dependency: "direct main" description: name: upgrader sha256: "0c5fe8101b9d3017aebcb5175b49c382699725ffcf477afbe93fc3351491f6e8" url: "https://pub.dev" source: hosted version: "9.0.0"

larryaasen commented 3 months ago

@RoberRaf The term debug does not imply a debug build of the app. An app can be debugged using a release build. The term debug implies debugging and diagnosing problems. See https://en.wikipedia.org/wiki/Debugging.