larryaasen / upgrader

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

Unable to alert testing users for a new version of the Internal Testing Version #454

Open kndrckjvr opened 2 months ago

kndrckjvr commented 2 months ago

I wanted to test out the alert dialog for our Internal Testing Users and wanted to use the AppCast Sample file to trigger the update. but testing out in my test device first as we just started using it, since the current version of testing application is 1.0.4, I needed to release a 2.0.0 or something like that, for this one I have used the testappcast.xml in this repository but it is not triggering the dialog.

I/flutter ( 3200): upgrader: instantiated
I/flutter ( 3200): upgrader: initialize called
I/flutter ( 3200): upgrader: build UpgradeAlert
I/flutter ( 3200): upgrader: instantiated
I/flutter ( 3200): upgrader: build UpgradeAlert
I/flutter ( 3200): upgrader: initializing
I/flutter ( 3200): upgrader: operatingSystem: android, version: XXXX
I/flutter ( 3200): upgrader: packageInfo packageName: com.x.x
I/flutter ( 3200): upgrader: packageInfo appName: x
I/flutter ( 3200): upgrader: packageInfo version: 1.0.4
I/flutter ( 3200): upgrader: current locale: en_SG
I/flutter ( 3200): upgrader: countryCode: SG
I/flutter ( 3200): upgrader: languageCode: en
I/flutter ( 3200): upgrader: instantiated
I/flutter ( 3200): upgrader: build UpgradeAlert
I/flutter ( 3200): upgrader: UpgraderAppcastStore item count: 4
I/flutter ( 3200): upgrader: UpgraderAppcastStore best item version: 5.0
I/flutter ( 3200): upgrader: UpgraderAppcastStore critical update item version: 2.0
I/flutter ( 3200): upgrader: UpgraderAppcastStore: version info: appStoreListingURL: null, appStoreVersion: 5.0.0, installedVersion: 1.0.4, isCriticalUpdate: true, minAppVersion: null, releaseNotes: null
  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      sha256: a8751904c13f7699bce3b28d8eedb6260e1c25311b75d4b712faeaedd996b7cc
      url: "https://pub.dev"
    source: hosted
    version: "11.2.0"

This is my main method.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Upgrader.clearSavedSettings();

  runApp(const MyApp());
}

This is the sample implementation in our Stateful Widget.

  static const appcastURL =
      'https://raw.githubusercontent.com/larryaasen/upgrader/master/test/testappcast.xml';
  final upgrader = Upgrader(
    storeController: UpgraderStoreController(
      onAndroid: () => UpgraderAppcastStore(appcastURL: appcastURL),
    ),
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: UpgradeAlert(
      upgrader: upgrader,
      ),
      child: Scaffold(...),
     );
  }