flutter_update_checker 0.1.2 flutter_update_checker: ^0.1.2 copied to clipboard
Simple package to check update for Android (Google Play, App Gallery, RuStore) and iOS (AppStore)
Flutter Update Checker - A Simple Package to Check for App Updates #
This package helps developers easily check for updates of their applications from various app stores, ensuring that users are notified about new versions with the latest features and bug fixes.
Table of Contents #
Features #
- Check for updates from the store where the application was downloaded.
- Retrieve the version from another store (except Google Play).
- Open links to the respective app store.
Platform support #
Feature | Android | iOS |
---|---|---|
App Store | ✅ | ✅ |
App Gallery | ✅ | ✅ |
Google Play | (Only if installed from Google Play)* | |
RuStore | ✅ | ✅ |
Important
Google Play update checks cannot be tested locally. You must install the app via Google Play. Refer to the official documentation for in-app updates.
Requirements #
- Android: Minimum SDK version 21 (API level 21) or higher.
- iOS: Minimum version 12 or higher.
Getting started #
To use this package on iOS, you must configure the Info.plist
file to allow the app to link to the App Store. Add the following entry:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>itms-apps</string>
</array>
This allows your app to open App Store links correctly.
Also, ensure you are using Semantic Versioning (X.Y.Z) in your pubspec.yaml:
version: 1.2.3+XXXXXX
Usage #
Refer to the example provided in the /example
folder for detailed usage.
Here's a simple example of how to check for updates:
import 'package:flutter_update_checker/flutter_update_checker.dart';
final updateChecker = UpdateStoreChecker(
iosAppStoreId: 564177498,
androidAppGalleryId: 'C101104117',
androidAppGalleryPackageName: 'com.vkontakte.android',
androidRuStorePackage: 'com.vkontakte.android',
androidGooglePlayPackage: 'com.vkontakte.android',
);
void checkForUpdates() async {
try {
// Check if an update is available
bool isUpdateAvailable = await updateChecker.checkUpdate();
if (isUpdateAvailable) {
print("An update is available!");
// Optionally open the store link
await updateChecker.update();
} else {
print("You're using the latest version.");
}
// Get the version from the store
String storeVersion = await updateChecker.getStoreVersion();
print("Latest version in store: $storeVersion");
} catch (e) {
print("Error checking for updates: $e");
}
}
Contributing #
Feedback and Pull Requests are most welcome!
License #
This package is licensed under the MIT License