I would like to know if my app is running with an external power cable attached. Is it possible to find out this state at runtime?
An extra question: would this be able
I had to include the line,
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
or else batteryState only returns UIDeviceBatteryStateUnknown. Perhaps this became necessary since this question was initially asked and answered. I found the tip here: Determine accurate iPhone battery level.