Hi You may write one plugin to get current battery level ,more about plugin dev check this and call this plugin inside deviceready event
*javascript
cordova.exec(function(status) {
console.log(status); //will get current ststus
}, function(error) {}, "Status",
"Status", ["givestatus"]);
this is the Native code Objective C
- (void)Status:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* pluginResult = nil;
NSString* myarg = [command.arguments objectAtIndex:0];
if (myarg != nil) {
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
UIDevice *myDevice = [UIDevice currentDevice];
[myDevice setBatteryMonitoringEnabled:YES];
double batLeft = (float)[myDevice batteryLevel] * 100;
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"%.f",batLeft]];
} else {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Arg was null"];
}
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
add new item to config.xml also
<feature name="Status">
<param name="ios-package" value="Status" />
</feature>