larryaasen / upgrader

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

Upgrader dialog doesn't show #346

Closed Kedmanee closed 3 months ago

Kedmanee commented 8 months ago

image I just copied code form example but no dialog show. Im not sure is there any cause by upgrader: blocked: true in log Here's log flutter: upgrader: blocked: true flutter: upgrader: debugDisplayAlways: false flutter: upgrader: debugDisplayOnce: false flutter: upgrader: hasAlerted: false flutter: upgrader: appStoreVersion: null flutter: upgrader: installedVersion: 1.0.0 flutter: upgrader: minAppVersion: 15.5.5 flutter: upgrader: isUpdateAvailable: false flutter: upgrader: shouldDisplayUpgrade: false flutter: upgrader: shouldDisplayReleaseNotes: false

upgrader: dependency: "direct main" description: name: upgrader sha256: "85496acfa024eb9e0c3c835d4c2358a000b21e021e9ca8835f56519ffa5e84f2" url: "https://pub.dev" source: hosted version: "8.2.0"

markusrut commented 8 months ago

i think isUpdateAvailable is your issue, even if you specify minAppVersion it still checks for available version befor showing prompt unless forced by debug flags

    if (debugDisplayAlways || (debugDisplayOnce && !_hasAlerted)) {
      rv = true;
    } else if (!isUpdateAvailable()) {
      rv = false;
    } else if (isBlocked) {
      rv = true;
    } else if (isTooSoon() || alreadyIgnoredThisVersion()) {
      rv = false;
    }
Kedmanee commented 8 months ago

how could i fix it

larryaasen commented 8 months ago

It says in the log: flutter: upgrader: appStoreVersion: null That means there was no app store version found. Has the app been published? Does the bundle ID match what is on the App Store?

iaohtdev commented 7 months ago

Just add await Upgrader.clearSavedSettings(); in main.dart

larryaasen commented 7 months ago

@iaohtdev You don't normally call clearSavedSettings() unless you are using it for testing.

ozancamur commented 5 months ago

@Kedmanee Is there any solution?