react-native-disable-battery-optimizations-android icon indicating copy to clipboard operation
react-native-disable-battery-optimizations-android copied to clipboard

There is no way to check if permission is granted or not

Open poliahrameshkumar opened this issue 3 years ago • 1 comments

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.

poliahrameshkumar avatar Oct 31 '21 07:10 poliahrameshkumar

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.

poliahrameshkumar avatar Nov 09 '21 09:11 poliahrameshkumar