What is the efficient way to manage permission in React Native?

Viewed 28

What would be the proper way to check permission and ask if not granted. And disable some entry point component if permission is not granted. It is easy at initial point but when app permission is changed anytime the app should take care of it. I tried to check permission every time app rendered and used useEffect to listen to permission states but it becomes messy.

So now I am changing the functional components to class component to acces lifecycle easily. I am avoiding the RN modules like redux as RN app size are greater.

I have also created some components which will appear on the basis of

granted,
denied,
never ask again

So if permission is granted or denied, It is simple to manage that but if permission is 'never ask again' then app will show the suggestion which will open the setting of the app. After that user would come back to app and app should aware of the permission changes

How should we manage these permissions and states?

0 Answers
Related