Before we start making use of these in the app, we should add them to a debug section/screen so QA can test them first. We need to test them on a number of different android phones to see how well they work before we implement them into end-user-visible screens.
Please:
Add a new debug screen or section which:
Displays the value returned by isIgnoringBatteryOptimizations()
Calls showIgnoreBatteryOptimizations() and:
Displays the values (of type DeviceSettingsRequest) returned by showIgnoreBatteryOptimizations()
Allows the user to optionally open the per-vendor 'Battery Optimisations' screen (ie. call show())
Calls showPowerManager and:
Displays the values (of type DeviceSettingsRequest) returned by showPowerManager
Allows the user to optionally open the per-vendor 'Power Manager' screen (ie. call show())
This will allow QA to test, on a variety of android phones, whether:
The value returned by isIgnoringBatteryOptimizations() is correct,
What the screens opened via showIgnoreBatteryOptimizations() and showPowerManager are (or whether they even exist at all)
It turns out RNBGL has a few APIs to help out with app battery optimisation issues.
See: https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.devicesettings.html#isignoringbatteryoptimizations
Before we start making use of these in the app, we should add them to a debug section/screen so QA can test them first. We need to test them on a number of different android phones to see how well they work before we implement them into end-user-visible screens.
Please:
isIgnoringBatteryOptimizations()
showIgnoreBatteryOptimizations()
and:DeviceSettingsRequest
) returned byshowIgnoreBatteryOptimizations()
show()
)showPowerManager
and:DeviceSettingsRequest
) returned byshowPowerManager
show()
)This will allow QA to test, on a variety of android phones, whether:
isIgnoringBatteryOptimizations()
is correct,showIgnoreBatteryOptimizations()
andshowPowerManager
are (or whether they even exist at all)