@maximilien0405/capacitor-android-relaunch
v7.0.3
Published
Capacitor plugin that keeps your Android app alive with foreground service and auto-relaunch capabilities
Maintainers
Readme
Capacitor Android Relaunch Plugin
The Capacitor Android Relaunch Plugin allows you to keep your Android app alive.
When enabled, this plugin will run a foreground service to monitor your app's process and automatically restart it if the system terminates it.
Installation
To install the plugin, run the following commands:
npm install @maximilien0405/capacitor-android-relaunch
npx cap syncAnd import it just like this:
import { AndroidRelaunch } from '@maximilien0405/capacitor-android-relaunch';Usage
Enable Relaunch Monitoring
This method enables the foreground service and starts monitoring your app's process. If the app gets killed, it will automatically be relaunched.
await AndroidRelaunch.enable();Disable Relaunch Monitoring
This method disables the foreground service and stops monitoring. The app will no longer be automatically relaunched if killed.
await AndroidRelaunch.disable();Requirements
- Android: API level 23+ (Android 6.0 Marshmallow and later)
- Capacitor: Version 7.0.0 or later
Support
For issues or feature requests, please open an issue on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
