Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog not showing anything despite the logs saying it should. #434

Open
davidgtu opened this issue Aug 9, 2024 · 3 comments
Open

Dialog not showing anything despite the logs saying it should. #434

davidgtu opened this issue Aug 9, 2024 · 3 comments
Labels
How To? This is a how to question

Comments

@davidgtu
Copy link

davidgtu commented Aug 9, 2024

Thank you for making this package.

I'm trying to implement this feature into my app but I can't seem to see it working locally despite my logs saying otherwise.

In my attempt to test this, In my pubspec.yaml I tried to fake the version.
My app is live with the version 3.22.2, and in pubspec.yaml I switched it so something lower, 3.22.0, but it doesn't work.

Here are my upgrader logs:

flutter: upgrader: instantiated
flutter: upgrader: initialize called
flutter: upgrader: build UpgradeAlert
flutter: upgrader: initializing
flutter: upgrader: operatingSystem: ios, version: Version 16.4 (Build 20E247)
flutter: upgrader: packageInfo packageName: com.xxx.xxx1
flutter: upgrader: packageInfo appName: xxx
flutter: upgrader: packageInfo version: 3.22.0
flutter: upgrader: current locale: en
flutter: upgrader: countryCode: US
flutter: upgrader: languageCode: en
flutter: upgrader: download: https://itunes.apple.com/lookup?bundleId=com.xxx.xxx1&country=US&_cb=1723226892210360
flutter: upgrader: response statusCode: 200
flutter: upgrader: UpgraderAppStore: version info: appStoreListingURL: https://apps.apple.com/us/app/xxx/xxx?uo=4, appStoreVersion: 3.22.2, installedVersion: 3.22.0, isCriticalUpdate: null, minAppVersion: null, releaseNotes: - Bug fixes
flutter: upgrader: need to evaluate version
flutter: upgrader: blocked: false
flutter: upgrader: debugDisplayAlways: false
flutter: upgrader: debugDisplayOnce: false
flutter: upgrader: hasAlerted: false
flutter: upgrader: installedVersion: 3.22.0
flutter: upgrader: minAppVersion: null
flutter: upgrader: isUpdateAvailable: true
flutter: upgrader: shouldDisplayUpgrade: true
flutter: upgrader: shouldDisplayReleaseNotes: true
flutter: upgrader: current locale: en
flutter: upgrader: languageCode: en
flutter: upgrader: showTheDialog title: Update App?
flutter: upgrader: showTheDialog message: A new version of Recora is available! Version 3.22.2 is now available-you have 3.22.0.
flutter: upgrader: showTheDialog releaseNotes: - Bug fixes

My assumption is that shouldDisplayUpgrade should mean it should display something, right? Is there anything blocking the dialog from displaying?

I've added UpgradeAlert to the top-level of my app as well:

 runApp(
      riverpod.ProviderScope(
        child: UpgradeAlert(
          upgrader: Upgrader(
            debugLogging: true,
          ),
          child: const App(),
        ),
      ),
    );

am I missing something? Is there something in the background that I'm not aware of and wouldn't work just by faking the version?

Thank you all.

@larryaasen
Copy link
Owner

Looking at the log you provided I see that the dialog was to be displayed: flutter: upgrader: showTheDialog title: Update App?
I think UpgradeAlert is too high in your widget tree because it need to be below MaterialApp. This may help from the example:

    return MaterialApp(
      title: 'Upgrader Example',
      home: UpgradeAlert(
        child: Scaffold(
          appBar: AppBar(title: const Text('Upgrader Example')),
          body: const Center(child: Text('Checking...')),
        ),
      ),
    );

@larryaasen larryaasen added the How To? This is a how to question label Aug 10, 2024
@ravinder-gs
Copy link

ravinder-gs commented Aug 23, 2024

I am facing same issue,

flutter: upgrader: response statusCode: 200
flutter: upgrader: UpgraderAppStore: version info: appStoreListingURL: https://apps.apple.com/in/app/colel-chabad-pushka/id1491701168?uo=4, appStoreVersion: 2.1.0, installedVersion: 1.0.0, isCriticalUpdate: null, minAppVersion: null, releaseNotes: - Share button
- Updated Settings Page
flutter: upgrader: need to evaluate version
flutter: upgrader: blocked: false
flutter: upgrader: debugDisplayAlways: true
flutter: upgrader: debugDisplayOnce: false
flutter: upgrader: hasAlerted: false
flutter: upgrader: shouldDisplayUpgrade: true
flutter: upgrader: shouldDisplayReleaseNotes: true
flutter: upgrader: current locale: en_US
flutter: upgrader: languageCode: en
flutter: upgrader: showTheDialog title: Update App?
flutter: upgrader: showTheDialog message: A new version of Pushka is available! Version 2.1.0 is now available-you have 1.0.0.
flutter: upgrader: showTheDialog releaseNotes: - Share button

My Code

MyAppProvider(
      child: MaterialApp.router(
        routerConfig: navigator.config(),
        title: F.title,
        locale: DevicePreview.locale(context),
        builder: (context, child) {
          return UpgradeAlert(
            upgrader: Upgrader(
              debugLogging: true,
              debugDisplayAlways: true,
              countryCode: 'US',
              minAppVersion: '1.0.0',
              languageCode: 'en',
              messages: UpgraderMessages(
                code: "en",
              ),
            ),
            child: child ?? const Text('child'),
          );

        },
        debugShowCheckedModeBanner: false,
        theme: appTheme,
      ),
    )

@akshatjain-beam
Copy link

@davidgtu , kindly check this -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
How To? This is a how to question
Projects
None yet
Development

No branches or pull requests

4 participants