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.
Flutter plugin implementing OTA update. On Android it downloads the file (with progress reporting) and triggers app installation intent. ##Migrating to 4.0. 0+ This update solves many problems arising from using android download manager and saving to external downloads folder.
==== 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.
https://firebase.google.com/docs/in-app-messaging
4. Make it by yourself. Maybe even less code then in the case with Firebase messaging.
It's not possible without using the google play store if you want an automatic update
.
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.
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With