Cordova lifecycle events.

Event Types

Accessing the Feature

As of version 3.0, Cordova implements battery status and other device-level APIs as plugins. Access to all other events not related to battery status are enabled by default. Use the CLI's plugin command, described in The Command-line Interface, to enable or disable battery events:

    $ cordova plugin add org.apache.cordova.battery-status
    $ cordova plugin ls
    [ 'org.apache.cordova.battery-status' ]
    $ cordova plugin rm org.apache.cordova.battery-status

These commands apply to all targeted platforms, but modify the platform-specific configuration settings described below:

  • Android

      (in app/res/xml/config.xml)
      <feature name="Battery">
          <param name="android-package" value="org.apache.cordova.batterystatus.BatteryListener" />
  • BlackBerry WebWorks

      (in www/plugins.xml)
      <feature name="Battery">
          <param name="blackberry-package" value="org.apache.cordova.battery.Battery" />
      (in www/config.xml)
      <feature id=""          required="true" version="" />
      <feature id=""    required="true" version="" />
      <feature id="blackberry.system.event" required="true" version="" />
  • iOS (in config.xml)

      <feature name="Battery">
          <param name="ios-package" value="CDVBattery" />
  • Tizen (in config.xml)

      <feature name="" required="true"/>

    Reference: Application Manifest for Tizen Web Application

Some platforms may support this feature without requiring any special configuration. See Platform Support in the Overview section.