项目作者: EvanBacon
项目描述 :
A tutorial on using permissions in React Native
高级语言: JavaScript
项目地址: git://github.com/EvanBacon/react-native-permissions-tutorial.git
React Native Permissions Tutorial
Hey guys, here is the source code from my tutorial on using Permissions in React Native with expo-permissions
.

If you found it helpful, be sure to like and subscribe 👍😁
Quick Notes
- On iOS and on Android, if you change a system permission the app will restart. This means there is no need to observe AppState changing.
- The Linking API has a URI scheme for opening the settings, this is the best (really the only) way to approve a pemission that was denied.
- Make sure to change the permission message before submitting to the App Store. This will save you from a lot of heartache in the future, be very clear about what you want to do with said permission.
- A lot of popular apps (like Google apps) have a modal that says “… Give us permissions …” Before actually prompting a user. The reason for this is that if the user denies the permission in this fake modal, then you can always show it to them again later. If a user actually wants to use the permission they will approve two modals. But if they don’t, you can try and make the permission usage more enticing.
Hope this Helps! 😁