isBatteryCharging event in background

I've done some research about background events on ios, and there are not many options... I need to create an app that at least starts the app in the background when the phone starts or stops charging.

Replies

I need to create an app that at least starts the app in the background when the phone starts or stops charging.

iOS does not let you run arbitrary tasks in the background. By default apps get suspended shortly after being moved to the background and only get resumed (or relaunched) when the user brings them to the front. To get resumed (or relaunched) in the background your must take advantage of some specific system service, like Core Location’s significant location change feature, or the background session support in

NSURLSession
. There is no explicit background support for power management events, and thus you won’t be able to achieve this goal.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"