UIDevice.current.isBatteryMonitoringEnabled value is always true

The documentation says the default value is false, yet when tested on two devices (iPhone 7 15.8; iPhone XS 17.4) the value is always true unless explicitly set to false. Is the documentation incorrect?

Accepted Reply

As the state of battery monitoring for your app is process-wide, it is likely that something else running in your app requested battery monitoring before you checked the value.

  • Thanks, found the library I'm using that does this.

Add a Comment

Replies

As the state of battery monitoring for your app is process-wide, it is likely that something else running in your app requested battery monitoring before you checked the value.

  • Thanks, found the library I'm using that does this.

Add a Comment