How can I implement auto-updating of my application when a new version is released without using Google Play Store? I'm using JSON to check the version.
-
Did you implement this feature in your app ? If yes, Can you please share the code ?K Pradeep Kumar Reddy– K Pradeep Kumar Reddy2020-08-20 20:29:16 +00:00Commented Aug 20, 2020 at 20:29
-
You can use pub.dev/packages/flutter_downloader and put the user to download the update (apk file) directly from your appmrapi– mrapi2020-10-05 13:35:16 +00:00Commented Oct 5, 2020 at 13:35
-
1This is the top most requested feature for flutter and is not supported as of today, you can follow the discussion here github.com/flutter/flutter/issues/14330Mahesh Jamdade– Mahesh Jamdade2021-08-29 08:21:05 +00:00Commented Aug 29, 2021 at 8:21
8 Answers
==== Update December 2021
new nice package, recommend this one https://pub.dev/packages/new_version
==== Actually, in June 2020, we have more possibilities with Flutter. Among them:
1. Make updates inside the app. Display two kinds of notifications if the app has the new version.
Plugin - https://pub.dev/packages/in_app_update (works only on Android, iOS doesn't support such functionality)
2. When a newer app version is available in the app store, a simple alert prompt widget or card is displayed.
Works Android & iOS. Plugin - https://pub.dev/packages/upgrader
3. Use Firebase in-app messaging. It gives flexibility in the messages and forms of notifications.
- But a lot more boilerplate code and work.
- But you can use it for other messages and notifications when your app is growing.
https://firebase.google.com/docs/in-app-messaging
4. Make it by yourself. Maybe even less code then in the case with Firebase messaging.
7 Comments
In-app updates works only with devices running Android 5.0 (API level 21) or higher, and requires you to use Play Core library 1.5.0 or higher. Additionally, in-app updates support apps running on only Android mobile devices and tablets, and Chrome OS devices.It's not possible without using the google play store if you want an automatic update.
- You need to handle the versioning yourself by hosting the apks somewhere (say github for example) and check if a new version exists and prompt the user whether they want to update the app.
- Then download the new apk in the background. (You can use this package)
- Then open the apk when it's done downloading using one of the methods mentioned here
- Which will then prompt the user whether to allow installing apks from your app
A plugin exists if you want to do it using the play store. in_app_update
Which wraps the android in-app update functionality

Their official example on github
If you also want an iOS solution, then it's not possible. You could redirect the user to the AppStore. Some more info on the distribution methods available for apple apps.
There is this method which might work if you have an enterprise license.
Whereas if you have a server running, have an endpoint to query the latest versions and another endpoint that allows users to download the apk.
Use something like github releases if you don't have a server.
Comments
This method gives you more control of your user's update flow instead of relying on third party UI solutions.
First, install the upgrader package and use their API to get the current version on the App Store or Play Store. Then, compare it to the currently installed app version on the user's device. You can use the package_info_plus package to do that. To compare the version names directly, use the the version package. Finally, you can decide what you want to do if the store version is greater than the installed version. For example, you can show an alert dialog, snackbar, or notification message to take the user to the app store, or you can implement your own UI.
How to use the upgrader package to get the store version number:
(Change the country code if your app is not available in the US)
import 'dart:developer';
import 'dart:io';
import 'package:html/dom.dart';
import 'package:upgrader/upgrader.dart';
Future<String?> getStoreVersion(String myAppBundleId) async {
String? storeVersion;
if (Platform.isAndroid) {
PlayStoreSearchAPI playStoreSearchAPI = PlayStoreSearchAPI();
Document? result = await playStoreSearchAPI.lookupById(myAppBundleId, country: 'US');
if (result != null) storeVersion = playStoreSearchAPI.version(result);
log('PlayStore version: $storeVersion}');
} else if (Platform.isIOS) {
ITunesSearchAPI iTunesSearchAPI = ITunesSearchAPI();
Map<dynamic, dynamic>? result =
await iTunesSearchAPI.lookupByBundleId(myAppBundleId, country: 'US');
if (result != null) storeVersion = iTunesSearchAPI.version(result);
log('AppStore version: $storeVersion}');
} else {
storeVersion = null;
}
return storeVersion;
}
Comments
Maybe this help you
Backend backend = Backend.instance();
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String packageName = packageInfo.packageName;
Response r;
try {
r = await backend.io.get("https://play.google.com/store/apps/details?id=$packageName&hl=en");
if(r.statusCode == 200){
String data = r.data;
String pat1 = 'Current Version</div><span class="htlgb"><div class="IQ1z0d"><span class="htlgb">';
String pat2 = '</span>';
int p1 = data.indexOf(pat1) + pat1.length;
String f = data.substring(p1, data.length);
int p2 = f.indexOf(pat2);
String currentVersion = f.substring(0, p2);
return currentVersion;
}
return null;
} catch (e) {
errors = backend.interceptor.errors;
return null;
}
1 Comment
Important Note:
Update notification will not appear if you installed your app through emulator(AVD) because the App signing key certificate of the tested app is different of that the google play use.
So,make sure to install your app through google play itself(not through android studio),and by this way,the update notification will work and the signed app certificate is the same as that google play provide to your app.
Comments
My way of implementation is to use a variable and compare that variable from a database. It could be Firebase or any other. For this example, I will use Firebase realtime database.
int version = 1;
void checkLatestVersion(){
//Here i am getting just the value of the latest version stored on firebase.
databaseReference.child("version").child("latestRealase").once().then((snapshot){
if(snapshot.value != null){
int versionNumberFromDatabase = int.parse(snapshot.value));
if(versionNumberFromDatabase>version){
print("the app needs to be updated");
//HERE you can create a dialog to display and force users to update
}else{
print("The app doesn't to be need updated ");
}
}
});
}
The above example will work for both Android and iOS, but there is a package that will let you update your app from the app itself. Check the documentation.
This will enables In-App Updates on Android using the official Android APIs.
1 Comment
You can use this package
https://pub.dev/packages/upgrader
Wrap your whole widget in UpgradeAlert widget like this ->
Scaffold(
appBar: AppBar(title: Text('Upgrader Example')),
body: UpgradeAlert(
child: Center(child: Text('Your widget is here')),
)),
1 Comment
This is the top most requested feature since the early days of Flutter repository and it is still open as of today. This has not been implemented into the flutter tooling and the framework due to security reasons, you can read more about the technicalities in this issue #14430 thread.
The good news is the creator of the issue is a former Flutter team member and they came up with a solution https://shorebird.dev/ to tackle this problem. I have used that in one of my apps https://github.com/maheshmnj/vocabhub and it works seamlessly for both IOS and Android and can be integrated into an existing app within minutes.
- Install the Shorbird CLI tool
- Initialize your project with shorebird
- Create a release using shorebird
- Release your app to stores
- Publish the patch using Shorebird
- Updates are automatically downloaded in the background when the user opens the app, this is also configurable to check for updates or notify when the update is available.
You can see a quick demo here https://www.youtube.com/watch?v=7KDgFvdogsE
Shorebird has a comprehensive and well-written doc to explains all the steps in detail https://docs.shorebird.dev/
One thing to note is that this is a paid service, However, on a free tier, you a get a generous 5k patches/month (at the time of writing) for free. So definitely checkout their pricing.



