In my iPhone app, there is a requirement to know whether the iPhone is charging or not?
If it is charging then I want to display alert for the same.
So how can I detect whether the iPhone is charging or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit: If you relly want to check if the device is charging (and not 100% full yet), use the
UIDeviceBatteryStateChargingconstant in the if statement. See the documentation for more information.