A Flutter port of the Android AutoStarter library that helps bring up the autostart permission manager on various OEM devices.
This package is a Flutter implementation of the original Android AutoStarter library created by judemanutd. All credit for the core functionality and manufacturer-specific implementations goes to the original project.
Many Android OEMs with custom UIs (like Xiaomi, Letv, etc.) restrict background processes by default, which can prevent your Flutter app from receiving push notifications or performing background tasks. This package provides a cross-platform way to request autostart permissions on supported devices.
- Detect if autostart permission is required on the current device
- Open the OEM-specific autostart permission screen
- Supports multiple manufacturers (see list below)
- Simple API that works across platforms (unsupported platforms fail gracefully)
Add this to your pubspec.yaml
:
dependencies:
flutter_autostart_android: ^1.0.0
Import the package:
import 'package:flutter_autostart_android/flutter_autostart_android.dart';
bool isAvailable = await FlutterAutostartAndroid.isAutoStartPermissionAvailable();
bool success = await FlutterAutostartAndroid.requestAutoStartPermission();
if (!success) {
// Show instructions to user or fallback behavior
}
The package currently supports:
- Xiaomi/Redmi
- Letv
- Honor
- Oppo
- Vivo
- Huawei
- Samsung
- Asus
- OnePlus
Note: Some implementations are untested - contributions welcome!
- Android: Fully supported with OEM-specific implementations (based on original AutoStarter library)
- iOS: No-op (returns false) as this concept doesn't exist on iOS
- Web: No-op (returns false)
Original Android library: AutoStarter
For more background on Android background restrictions:
Contributions are welcome! Please open issues or PRs for:
- New OEM implementations
- Bug fixes
- Test coverage improvements