react-native-disable-battery-optimizations-android
react-native-disable-battery-optimizations-android copied to clipboard
There is no way to check if permission is granted or not
I could see there is a method openBatteryModal(). But there is no way to check if permission is granted or not. Please guide me on how to check granted status using this package as I have no clue.
I handled grant status when the app moves from background to foreground when the permission popup is dismissed using React Native AppState https://stackoverflow.com/questions/69787403/how-to-get-grant-staus-from-battery-optimization-permission-popup/69813796. But still in Xiomi Android 11 devices, after allowing the permission, it redirects to settings page to get one of the four options. So, it is very tricky to handle the permission response in those devices.