green-code-initiative / ecoCode-android

Reduce the environmental footprint of your Java-based Android apps with SonarQube
https://ecocode.io
GNU General Public License v3.0
58 stars 18 forks source link

[iOS] Power - Save Mode Awareness (EPOW002) #48

Closed davidy4ng closed 1 year ago

davidy4ng commented 1 year ago

Description

Use device API to check if low power mode is enabled, and adapt resources usage accordingly. For example, you can reduce frequency of data update if low power mode is enabled. Your app can query the ProcessInfo.processInfo.isLowPowerModeEnabled property at any time to determine whether Low Power Mode is active. Your app can also register to receive notifications when the Low Power Mode state of a device changes, using NSProcessInfoPowerStateDidChange.

zippy1978 commented 1 year ago

Addressed by https://github.com/green-code-initiative/ecoCode-mobile/pull/55