timtraversy / new_version Goto Github PK
View Code? Open in Web Editor NEWCheck if your user has the most recent version of your Flutter app.
License: BSD 3-Clause "New" or "Revised" License
Check if your user has the most recent version of your Flutter app.
License: BSD 3-Clause "New" or "Revised" License
The Whole Example Code isn't working for me
I want to be able to test the feature without changing the version of the app. How can I do it?
NewVersion(context: context).showAlertIfNecessary();
Idea:
debug: true
param to showAlertIfNecessary
NewVersion(context: context).showAlertIfNecessary(debug: true);
flutter: Can't find an app in the App Store with the id: 1581147352
final newVersion = NewVersion(
iOSId: '1581147352',
androidId: 'com.egphp.christian_dogma',
iOSAppStoreCountry: 'EG',
);
basicStatusCheck(NewVersion newVersion) {
newVersion.showAlertIfNecessary(context: context);
}
basicStatusCheck(newVersion);
please help
Hi great developer!
I like this package very much and have already used it in several apps.
However, the default for this package is to explicitly check the status to see if an update is available. For example, in the following case.
final newVersion =
NewVersion(androidId: FlavorConfig.instance.variables['androidId']);
final status = await newVersion.getVersionStatus();
// ↓ This
if (status!.canUpdate) {
newVersion.showUpdateDialog(
context: context,
versionStatus: status,
dialogTitle: 'New Version Is Available!',
updateButtonText: 'Update Right Now',
dismissButtonText: 'Skip',
);
}
I didn't know about the canUpdate method when I first started using this package, and I thought that the package was doing this internally. And what happened was that I got this dialog even in the same case as the current version.
Are there any design circumstances that would require this to be done this way? I imagine that updates may remove internal processing from the app, but the version will always go up, and I don't see the benefit of using canUpdate to determine when to implement using this package.
Anyway thanks for the amazing development!
Does the package have a feature to remind users after some days to update incase they click on “Ignore”?
this package is showing update for every version even the update is not available
I don't know why I'm facing this issue. When my local app version and PlayStore version are the same after that show this pop-up.
I'm using very simple code and default code
@override
void initState() {
super.initState();
...
checkVersion();
}
void checkVersion() async {
final newVersion = NewVersion(
androidId: "banda.app",
);
final status = await newVersion.getVersionStatus();
newVersion.showUpdateDialog(
versionStatus: status,
context: context,
);
}
This is a Screenshot:- https://user-images.githubusercontent.com/53011602/133896317-4ba20fa4-0e10-4c05-b02f-193073fe070b.jpg
This code work on our project.
@override
void initState() {
super.initState();
...
checkVersion();
}
void checkVersion() async {
final newVersion = NewVersion(
androidId: "banda.app",
);
final status = await newVersion.getVersionStatus();
// I'm checking manual add If condition
if (status.localVersion != status.storeVersion) {
newVersion.showUpdateDialog(
versionStatus: status,
context: context,
);
}
}
Please add a feature to set the country where the appstore,playstore get the version of the app.
Hey,
I would like to disable possibility to hide/close popup if the app is not updated.
I dont want to close the dialog on backdrop click.
Currently my app is using url_launcher package with the latest version, when trying to install this new_version package, this error message pops up:
$ flutter pub get
"Because every version of new_version depends on url_launcher ^4.0.3 and <MY_APP_NAME> depends on url_launcher ^5.4.1, new_version is forbidden. So, because <MY_APP_NAME> depends on new_version ^0.0.4, version solving failed."
I believe you need to update your url_launcher package to solve this problem, thank you.
Please, add a option to pass a text widget instead of string. Thanks.
Hi, I see that the only option of receiving the App Store version data is through a Future. It might be a good reason for why that is, but in case I want to force the user to update, I would need the information about a newer version to come through asap. So the rebuilds and I can tell the user to update before he does anything crazy, is there a possibility to add a stream as well, that would send data when a newer version is available?
E/flutter (24494): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: setState() or markNeedsBuild() called during build.
E/flutter (24494): This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
Hi!
Thx for all the work You did with plugin!
However I struggle to get it going...
I get:
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: SocketException: Failed host lookup: 'play.google.com' (OS Error: No address associated with hostname, errno = 7)
while traing to invoke: showAlertIfNecessary.
My app have all Internet rights.
App is published on play store, and I debug it by implamanting code, and descreesing version lvl.
Any ideas?
Thx a lot for any help
Is there a way to use your library to validate new versions for internal test or testflight cases? This for an app that is not yet available to the general public?
When I followed the example code:
` @OverRide
void initState() {
super.initState();
// Implementation is here
final newVersion = NewVersion(
iOSId: 'com.google.Vespa',
androidId: 'com.google.android.apps.cloudconsole', // I used my own Id here I just copied your sample code..
);
newVersion.showAlertIfNecessary(context: context);
}
it will give error like that in the image.. but I only just followed the sample code...
The argument type 'VersionStatus?' can't be assigned to the parameter type 'VersionStatus'
This is my code
final versionStatus = await newversion.getVersionStatus();
newversion.showUpdateDialog(context: context, versionStatus: versionStatus);
Even when the application id does not exist, the request returns status 200. Therefore, it generates an error when obtaining the results [0] in the array.
A suggestion would also be to provide the option of passing the title and message of the dialog by parameter so that we can use other languages.
I look forward to it.
Thank you.
This is the error [VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0
I used this plug-in in my app.. But app not showing alert if play store version is installed..... And when I tried it with debug mode.. It shows alert, but in that case play store shows only Open option instead of Update..
Sorry for my bad communication skills
My bundle Id is com.healthSolutions.healthService.iOS.
I am struck at this for last 3 days where I am giving the correct bundle Id.
|| --- Attaching Screenshot --- ||
I ran into a case where the new app version is 1.10.1 and the store version is 1.9.4. In this case the comparison logic fails, and reports that an update is available.
After a couple of iterations, I settled on the following code for the comparison. There is probably a better way.
bool get canUpdate {
final localFields = localVersion.split('.');
final storeFields = storeVersion.split('.');
String localPad = '';
String storePad = '';
for (int i = 0; i < storeFields.length; i++) {
localPad = localPad + localFields[i].padLeft(3, '0');
storePad = storePad + storeFields[i].padLeft(3, '0');
}
if (localPad.compareTo(storePad) < 0)
return true;
else
return false;
}
Hi, when I call showAlertIfNecessary
function the alertDialog shows "Maybe Later" and "Update" actions. Please note the sequence.
And when I call showUpdateDialog
the alertDialog shows "Update" and "Maybe Later", here the sequence of the actions don't match.
For now, I've just changed the sequence at which the actions are added to the actions array.
Use https://pub.dev/packages/package_info_plus instead package_info
because it supports web.
Hello, guys!
I have an issue with this package for ios.
I have submitted new version ios to the app store and approved.
But still get old version for ios store version.
Who can guide me how to solve this issue?
It is very important thing for me. Cuz I should make our customers force upgrade to new version.
Thanks
I'm getting this:
[log] First beta release of the application for open testing.
[log] https://play.google.com/store/apps/details?id=com.rationaltabs.meir_shop
[log] 1.0.2 (localversion)
[log] Varies with device (storevesion)
[log] true
i am using latest version of package
Hello, please, can you create a new version on pub.dev (0.0.6) with last releases?
Hello, I had some problems using on Android plugin when I clicked the button to close the dialog.
Using Navigator.pop (context) removed my overlapping page. Checking the documentation of showDialog I found this: https://api.flutter.dev/flutter/material/showDialog.html
/// If the application has multiple [Navigator] objects, it may be necessary to
/// call `Navigator.of (context, rootNavigator: true) .pop (result)` to close the
/// dialog rather than just `Navigator.pop (context, result)`.
After making the change, it worked perfectly and I believe there will be no problem if it is changed ....
Taking advantage of it I made some changes so that it has more optional parameters in the constructor, to be more customizable ...
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0
#0 List.[] (dart:core-patch/growable_array.dart:254:60)
#1 NewVersion._getiOSStoreVersion (package:new_version/new_version.dart:126:39)
#2 _HomeScreenState._checkVersion (package:alert_update_version/main.dart:47:20)
final status = await newVersion.getVersionStatus();
newVersion.showUpdateDialog(
context: context,
versionStatus: status, // The argument type 'VersionStatus?' can't be assigned to the parameter type 'VersionStatus' ,
);
new_version 0.2.0
final status = await newVersion.getVersionStatus();
status.canUpdate // (true)
status.localVersion // (1.2.1)
status.storeVersion // (1.2.3)
Hey.
Thanks for your nice plugin.
I have a weird issue,
The package does not recognize that my app exists at all.
I'm not sure if it's your issue, or something wrong with the App Store,
But the api you're connecting to returning 0 results for my package name.
Is there should be any special settings for the API to recognize the application?
It's published in App Store (only for certain countries).
Will appreciate some help in here regarding this.
Because new_version >=0.1.0 depends on http ^0.13.1 and google_fonts <2.0.0-nullsafety.0 depends on http ^0.12.0+2, new_version >=0.1.0 is incompatible with google_fonts <2.0.0-nullsafety.0.
So, because buy_app_flutter depends on both google_fonts ^0.3.5 and new_version ^0.2.0, version solving failed.
pub get failed (1; So, because buy_app_flutter depends on both google_fonts ^0.3.5 and new_version ^0.2.0, version solving failed.)
Process finished with exit code 1
I dont seem to find a way to customize the buttons or their style. It'd be nice to give more flexibility on this.
Today, my app's new version is published on Google Play Store. I had an old version of my app installed in my device. When I started the app, it asked me to update the app. But when I click the link, I got "web page does not exists" error.
intent://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id%3Dcom.swoddy.swoddy_app#Intent;package=com.google.android.gms;scheme=https;S.browsefallback_url=https://play.google.com/store/apps/details%3Fid%3Dcom.swoddy.swoddy_app;end;
I have the latest version of new_version package (v0.0.5).
Please with this package, can I customize the update message?
Is there a way to get the release note from the server?
Thank you very much for this package
We have Cyrillic letters in appstore link like https://apps.apple.com/ru/app/%D0%B5%D0%B4_____/id______
and we cant launch it on safari without Using decodeFull like that
void _launchAppStore(String appStoreLink) async {
debugPrint(appStoreLink);
final link = Uri.decodeFull(appStoreLink);
if (await canLaunch(link)) {
await launch(link);
} else {
throw 'Could not launch appStoreLink';
}
}
Let the returned storeVersion value be as the same release of the localVersion
I mean if the local release is beta then return the storeVersion of last beta release not production release
update button for our application is not showing in play store, even store version is greater than local version
help me how to solve this in android platform
I have currently tested the lib. but you did not provide exception checker on these two methods :
I would have branched the changes I did on my forked project, but I'm not able !
Just adding try...catch to returned values:
FOR IOS: _getiOSStoreVersion()
try { return VersionStatus._( localVersion: packageInfo.version, storeVersion: jsonObj['results'][0]['version'], appStoreLink: jsonObj['results'][0]['trackViewUrl'], releaseNotes: jsonObj['results'][0]['releaseNotes'], ); } catch (exc) { return null; }
FOR ANDROID: _getAndroidStoreVersion()
try { return VersionStatus._( localVersion: packageInfo.version, storeVersion: storeVersion, appStoreLink: uri.toString(), releaseNotes: releaseNotes, ); } catch (exc) { return null; }
Lets say my local version is 2.0.0 but app store version is 1.0.0. Now, the logic of this package returns that the app can still be updated, so it is quite important to always confirm that the version number is smaller than the app store version.
Another feature is to provide a way to customize the text of the dialog.
Thank you so much and really appreciate if you could make such changes.
Hi,
there is a serious bug in current null-safe version of the plugin
my pull request fixes it
#44
The description is inside
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.