in_app_update_android 1.1.1
in_app_update_android: ^1.1.1 copied to clipboard
A Flutter plugin for prompting users about Android in-app updates using Play Core API.
in_app_update_android
A Flutter plugin for Android in-app updates using the Google Play Core In-App Update API.
Features #
- Check Google Play for update availability
- Immediate full-screen update flows
- Flexible background update flows with reliable progress tracking
- Install state and download progress listeners
- Flexible update completion handling
- Optional
allowAssetPackDeletionfor low-storage devices - Typed Dart exceptions for unsupported platforms
Requirements #
| Requirement | Details |
|---|---|
| Flutter | >=3.24.0 |
| Dart | >=3.5.0 |
| Android API | 21+ |
| Installation | Google Play, Internal App Sharing, or any Play testing track |
Note: In-app updates do not work with locally sideloaded debug APKs. Use Play internal app sharing or a testing track when developing.
Quick Start #
import 'package:in_app_update_android/in_app_update_android.dart';
Future<void> checkAndUpdate() async {
if (!InAppUpdate.isAndroid) return;
final info = await InAppUpdate.checkForUpdate();
if (!info.updateAvailable) return;
if (info.immediateUpdateAllowed || info.immediateUpdateInProgress) {
await InAppUpdate.performImmediateUpdate();
return;
}
if (info.flexibleUpdateAllowed) {
InAppUpdate.installStateListener.listen((state) async {
if (state.installStatus == InstallStatus.downloaded) {
await InAppUpdate.completeFlexibleUpdate();
}
});
await InAppUpdate.startFlexibleUpdate();
}
}
Tip: Subscribe to
installStateListenerbefore callingstartFlexibleUpdate()for the most responsive UI.
API Reference #
| Method | Returns | Description |
|---|---|---|
InAppUpdate.isAndroid |
bool |
Check if running on Android |
checkForUpdate() |
Future<AppUpdateInfo> |
Check for available updates |
performImmediateUpdate() |
Future<AppUpdateResult> |
Start immediate update |
startFlexibleUpdate() |
Future<AppUpdateResult> |
Start flexible update |
completeFlexibleUpdate() |
Future<void> |
Complete downloaded flexible update |
installStateListener |
Stream<InstallState> |
Stream install state & progress events |
Play Console Notes #
- Update priority is controlled via
inAppUpdatePriorityin the Play Developer API. clientVersionStalenessDaysis provided by Google Play when available.- Update availability may be delayed by Play Store caching and rollout state.
License #
MIT