-
Notifications
You must be signed in to change notification settings - Fork 29
feat: prompting users to upgrade when newer app version available #1061
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
base: master
Are you sure you want to change the base?
Conversation
Integrate the `upgrader` package to prompt users to update the app when a new version is available. Wrap the main application widget with `UpgradeAlert` to enable the update check functionality.
Allow the app to handle HTTPS URLs with specified actions and categories by adding intent filters in the AndroidManifest.xml.
Add version and build number display in the app drawer using the `package_info_plus` package. Include dynamic rendering through `FutureBuilder`.
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR only works with play store. Users who download the app from Github will still be prompted to go to the play store for updates.
I'm not sure how to easily determine if the app is installed from an APK or from the Google Play Store (or other app stores). Therefore, we have two options:
I would prefer the second option. Is there any better option available? |
Once we know where the user installed the app from, we can either use the What do you think @anhappdev? |
Replace `UpgradeAlert` with a new `UpgradeDialog` widget to customize the "Update now" button functionality. Redirect users to the appropriate app store or GitHub Releases page based on the installer source.
@farook-edev Yes, the |
Adjust the "Update now" functionality to handle updates differently for Android by introducing a custom URL resolution method and preventing default behavior when the update action is handled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the couple items I noticed in the comments below, LGTM 🚀👍
child: Text( | ||
versionText, | ||
style: Theme.of(context).textTheme.bodySmall?.copyWith( | ||
color: AppColors.drawerForeground.withOpacity(0.6), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it would be best to avoid using non-opaque colors unless necessary. They're much more costly to render than simple 0xFF######
colors.
|
||
@override | ||
Widget build(BuildContext context) { | ||
final upgrader = Upgrader( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nice to have here would be an UpgraderStore
that checks the version on github releases, but this isn't absolutely necessary, we can rely on play store version for now.
If users tap on "Update Now," they will be redirected to the app store page of the app, where they can tap on the update button to update the app.