@@ -12,6 +12,7 @@ The current supported permissions are:
1212- Bluetooth * (iOS only)*
1313- Push Notifications * (iOS only)*
1414- Background Refresh * (iOS only)*
15+ - Speech Recognition * (iOS only)*
1516
1617
1718| Version | React Native Support |
@@ -56,15 +57,15 @@ const Permissions = require('react-native-permissions');
5657 Permissions .checkMultiplePermissions ([' camera' , ' photo' ])
5758 .then (response => {
5859 // response is an object mapping type to permission
59- this .setState ({
60+ this .setState ({
6061 cameraPermission: response .camera ,
6162 photoPermission: response .photo ,
6263 })
6364 });
6465 }
6566
6667 // this is a common pattern when asking for permissions.
67- // iOS only gives you once chance to show the permission dialog,
68+ // iOS only gives you once chance to show the permission dialog,
6869 // after which the user needs to manually enable them from settings.
6970 // the idea here is to explain why we need access and determine if
7071 // the user will say no, so that we don't blow our one chance.
@@ -75,7 +76,7 @@ const Permissions = require('react-native-permissions');
7576 ' We need access so you can set your profile pic' ,
7677 [
7778 {text: ' No way' , onPress : () => console .log (' permission denied' ), style: ' cancel' },
78- this .state .photoPermission == ' undetermined' ?
79+ this .state .photoPermission == ' undetermined' ?
7980 {text: ' OK' , onPress: this ._requestPermission .bind (this )}
8081 : {text: ' Open Settings' , onPress: Permissions .openSettings }
8182 ]
@@ -110,6 +111,7 @@ Promises resolve into one of these statuses
110111| ` reminder ` | ✔️ | ❌ |
111112| ` notification ` | ✔️ | ❌ |
112113| ` backgroundRefresh ` | ✔️ | ❌ |
114+ | ` speechRecognition ` | ✔️ | ❌ |
113115| ` storage ` | ❌️ | ✔ |
114116
115117###Methods
@@ -163,14 +165,15 @@ All required permissions also need to be included in the Manifest before they ca
163165
164166Permissions are automatically accepted for targetSdkVersion < 23 but you can still use ` getPermissionStatus ` to check if the user has disabled them from Settings.
165167
166- Here's a map of types to Android system permissions names:
167- ` location ` -> ` android.permission.ACCESS_FINE_LOCATION `
168- ` camera ` -> ` android.permission.CAMERA `
169- ` microphone ` -> ` android.permission.RECORD_AUDIO `
170- ` photo ` -> ` android.permission.READ_EXTERNAL_STORAGE `
171- ` storage ` -> ` android.permission.READ_EXTERNAL_STORAGE `
172- ` contacts ` -> ` android.permission.READ_CONTACTS `
173- ` event ` -> ` android.permission.READ_CALENDAR `
168+ Here's a map of types to Android system permissions names:
169+ ` location ` -> ` android.permission.ACCESS_FINE_LOCATION `
170+ ` camera ` -> ` android.permission.CAMERA `
171+ ` microphone ` -> ` android.permission.RECORD_AUDIO `
172+ ` photo ` -> ` android.permission.READ_EXTERNAL_STORAGE `
173+ ` storage ` -> ` android.permission.READ_EXTERNAL_STORAGE `
174+ ` contacts ` -> ` android.permission.READ_CONTACTS `
175+ ` event ` -> ` android.permission.READ_CALENDAR `
176+
174177
175178You can request write access to any of these types by also including the appropriate write permission in the Manifest. Read more here: https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous
176179
@@ -181,7 +184,7 @@ npm install --save react-native-permissions
181184rnpm link
182185````
183186
184- ###Or manualy linking
187+ ###Or manualy linking
185188
186189####iOS
187190* Run open node_modules/react-native-permissions
@@ -233,10 +236,10 @@ public class MainApplication extends Application implements ReactApplication {
233236##Troubleshooting
234237
235238#### Q: Android - ` undefined is not a object (evaluating 'RNPermissions.requestPermissions') `
236- A: ` rnpm ` may not have linked correctly. Follow the manual linking steps and make sure the library is linked
239+ A: ` rnpm ` may not have linked correctly. Follow the manual linking steps and make sure the library is linked
237240
238241#### Q: iOS - app crashes as soon as I request permission
239242A: starting with xcode 8, you need to add permission descriptions. see iOS notes for more details. Thanks to @jesperlndk for discovering this.
240243
241244#### Q: iOS - app crashes when I change permissions from settings
242- A: This is normal. iOS restarts your app when your privacy settings change. Just google "ios crash permission change"
245+ A: This is normal. iOS restarts your app when your privacy settings change. Just google "ios crash permission change"
0 commit comments