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

Alert never displayed on Android #260

Closed Smibser closed 1 year ago

Smibser commented 1 year ago

Hi, I have a problem that the alert never getting displayed on android. I debugged a little by myself through the package and noticed that the _appStoreVersion is fetched correctly. But the checkVersion method is never called (on iOS it is). I somehow have the feeling that the fetching of the _appStoreVersion takes so long that it blocks the alert. Could that be the problem or is it on my side?

I/flutter (32404): upgrader: instantiated.
I/flutter (32404): upgrader: build UpgradeAlert
I/flutter (32404): upgrader: initialize called
I/flutter (32404): upgrader: initializing
I/flutter (32404): upgrader: languageCode: de
I/flutter (32404): upgrader: default operatingSystem: android PPR1.180610.011 release-keys
I/flutter (32404): upgrader: operatingSystem: android
I/flutter (32404): upgrader: platform: TargetPlatform.android
I/flutter (32404): upgrader: isAndroid: true, isIOS: false, isLinux: false, isMacOS: false, isWindows: false, isFuchsia: false, isWeb: false
I/flutter (32404): upgrader: package info packageName: com.------
I/flutter (32404): upgrader: package info appName: ------
I/flutter (32404): upgrader: package info version: 1.0.0
I/flutter (32404): upgrader: countryCode: DE
I/flutter (32404): upgrader: languageCode: de
I/flutter (32404): upgrader: lookupById url: https://play.google.com/store/apps/details?id=-----&gl=DE&hl=de&_cb=1674573191048285
  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      url: "https://pub.dartlang.org"
    source: hosted
    version: "5.1.0"
Smibser commented 1 year ago

Okay it just worked once

Smibser commented 1 year ago

If I set a breakpoint where i added a widget and wait a second then it works. So it is probably on my side. I will post it if i find a solution

larryaasen commented 1 year ago

@Smibser I put a 5 second wait/delayed in the lookupById on Android to simulate a very slow response, and I still see the alert. Can you share the Dart code where you use UpgradeAlert?