Muruganandham K
Muruganandham K

Reputation: 5331

Control low battery mode from an iOS application

I would like switch on/off low power mode in an application. Is it possible to control battery mode from an iOS application.

Upvotes: 2

Views: 1482

Answers (1)

Anbu.Karthik
Anbu.Karthik

Reputation: 82759

Apple has not exposed any public APIs to allow control of low power mode.

but we can Detecting Low Power mode using the following code , the detail information provided in Apple Documents

Objective C

if ([[NSProcessInfo processInfo] isLowPowerModeEnabled]) {
// Low Power Mode is enabled. Start reducing activity to conserve energy.
} else {
// Low Power Mode is not enabled.
}

Swift

if ProcessInfo.processInfo.isLowPowerModeEnabled {
            // Low Power Mode is enabled. Start reducing activity to conserve energy.
        } else {
            // Low Power Mode is not enabled.
        }

Upvotes: 3

Related Questions