简体   繁体   中英

How to know if iOS user declined permission or not on react-native?

I have an app that requires camera access. On android side I am asking for permission but on iOS side you don't have to request permission because Apple do it for you (from plist). But in that case I don't know if iOS user accepted or rejected the permission request. How can I know user is accepted request or not on iOS device.

If user will decline the permission I will navigate to other screen and if accepted camera will open.

I didn't find any answer on stackoverflow or react-native documentation.

Thanks in advance.

You could use permissions library to ask for permission, and store whether you already asked it in the device local AsyncStorage.

I am not sure it is possible to tell whether they've rejected some permissions from the OS.

An unified permissions API for React Native on iOS and Android.

https://github.com/yonahforst/react-native-permissions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM