cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jcesarmobile (JIRA)" <>
Subject [jira] [Commented] (CB-8955) iOS - Current Battery Status
Date Sat, 16 May 2015 17:12:59 GMT


jcesarmobile commented on CB-8955:

Maybe it should return the battery current status the first time

The battery plugin seems to follow an old W3C API recommendation:

Maybe the plugin should be updated to use the latest recommendation
It has a navigator.getBattery() method that provides the level on the first call and you can
set a listener for levelchange

navigator.getBattery().then(function(battery) {
  battery.addEventListener('levelchange', function() {

> iOS - Current Battery Status
> ----------------------------
>                 Key: CB-8955
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Plugin Battery Status
>         Environment: iOS
>            Reporter: Matthew Keable
>            Priority: Minor
> My understanding of the current Battery Status plugin on iOS is that we can only receive
data via the battery status listeners. However, these only fire when the device is (un)plugged
or the battery percentage changes by 1%.
> There doesn't seem to be a method that enables you to get the current status. For instance
I have an app that I'd like to be able to show the current battery status on screen, but on
launch those values remain empty until the first time this listener fires.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message