This Cordova plugin will start automatically your Android app or service after the every boot or the auto-update of your application. You can enable or disable the autostart function in your app. The plugin is also compatible with PhoneGap Build.
Enable the automatic startup of your app after the boot
Not applicable in macOS.
Enable the automatic startup of your service after the boot
In macOS, pass the bundle identifier of a helper application to launch it at startup.
Disable the automatic startup of your app and service after the boot
This is the default action if you have never called the "enable" function.
Indication of automatic startup
If the automatic startup has occured, the Android intent includes the attribute "cordova_autostart" with value true. See more instructions to utilize it at related plugins.
macOS helper application
Sandboxed macOS applications are not allowed to write arbitrary files, which means that they cannot register themselves as Launch Agents. Instead, Apple allows the registration of a helper application, embedded in the main app's bundle, to start on boot and launch the main app.
disable actions will register/unregister the helper application to launch on startup. It is the caller's responsibility to implement the helper app. See Apple's documentation for more details.
- cordova-plugin-intent to check out the "cordova_autostart" from extras of Android intent, if your app has automatically started. See more details from here.
- cordova-android-movetasktoback to move your app to background
- cordova-plugin-background-mode to keep your app running
Local development environment
# ~~ from master branch ~~ cordova plugin add https://github.com/ToniKorin/cordova-plugin-autostart.git
from a local folder:
# ~~ local folder ~~ cordova plugin add cordova-plugin-autostart --searchpath path
or to use the latest stable version:
# ~~ stable version ~~ cordova plugin add firstname.lastname@example.org
To remove the plug-in, run the following command:
cordova plugin rm cordova-plugin-autostart
Add the following xml line to your config.xml:
<gap:plugin platform="android" name="cordova-plugin-autostart" version="2.3.0" source="npm"/>
- Installation to the SD card will prevent the automatic start of your app after the boot. See more details from here.
- During the boot your app may start before it has no network connectivity. Your app have to take care of it e.g. using the cordova-plugin-network-information.
Check the Change Log.
This software is released under the Apache 2.0 License.
© 2015 Toni Korin