Turn on battery monitoring for your app
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
Getting The Current State
//----- DISPLAY BATTERY STATE -----
if ([[UIDevice currentDevice] batteryState] == UIDeviceBatteryStateUnknown)
{
[BatteryStateLabel setText:@""];
}
else
{
NSString *BatteryString = [NSString stringWithFormat:@"Battery: %0.0f%%", [[UIDevice currentDevice] batteryLevel] * 100];
switch ([[UIDevice currentDevice] batteryState])
{
case 1:
//Battery is in use (discharging)
break;
case 2:
//Battery is charging
BatteryString = [BatteryString stringByAppendingString:@" (charging)"];
break;
case 3:
//Battery is fully charged
BatteryString = [BatteryString stringByAppendingString:@" (charged)"];
break;
default:
//Battery status is unknown
break;
}
[BatteryStateLabel setText:BatteryString];
}
Good Resources
http://iphonedevelopertips.com/device/display-battery-state-and-level-of-charge.html