Take the 2-minute tour ×

I'm trying to determine if he device is plugged in and charging. How do I find out in ios 5.x or higher?

share|improve this question
possible duplicate of iPhone4 how to find out if the power cable is plugged in? –  hypercrypt Jul 2 '12 at 22:03
add comment

1 Answer

up vote 1 down vote accepted

you can use UIDevice to get these info

Use the following

[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];

if ([[UIDevice currentDevice] batteryState] == UIDeviceBatteryStateCharging)
    NSLog(@"device is conected to power");
share|improve this answer
add comment

Your Answer


