瀏覽代碼

Update README

Tres Trantham 7 年之前
父節點
當前提交
0414316163
共有 1 個文件被更改,包括 15 次插入13 次删除
  1. 15
    13
      README.md

+ 15
- 13
README.md 查看文件

@@ -12,6 +12,7 @@ The current supported permissions are:
12 12
 - Bluetooth *(iOS only)*
13 13
 - Push Notifications *(iOS only)*
14 14
 - Background Refresh *(iOS only)*
15
+- Speech Recognition *(iOS only)*
15 16
 
16 17
 
17 18
 ###New in version 0.2.X
@@ -51,10 +52,10 @@ const Permissions = require('react-native-permissions');
51 52
 
52 53
   //check the status of multiple permissions
53 54
   _checkCameraAndPhotos() {
54
-    Permissions.checkMultiplePermissions(['camera', 'photo'])
55
+    Permissions.checkMultiplePermissions(['camera', 'photo', 'speechRecognition'])
55 56
       .then(response => {
56 57
         //response is an object mapping type to permission
57
-        this.setState({ 
58
+        this.setState({
58 59
           cameraPermission: response.camera,
59 60
           photoPermission: response.photo,
60 61
         })
@@ -62,7 +63,7 @@ const Permissions = require('react-native-permissions');
62 63
   }
63 64
 
64 65
   // this is a common pattern when asking for permissions.
65
-  // iOS only gives you once chance to show the permission dialog, 
66
+  // iOS only gives you once chance to show the permission dialog,
66 67
   // after which the user needs to manually enable them from settings.
67 68
   // the idea here is to explain why we need access and determine if
68 69
   // the user will say no, so that we don't blow our one chance.
@@ -73,7 +74,7 @@ const Permissions = require('react-native-permissions');
73 74
       'We need access so you can set your profile pic',
74 75
       [
75 76
         {text: 'No way', onPress: () => console.log('permission denied'), style: 'cancel'},
76
-        this.state.photoPermission == 'undetermined'? 
77
+        this.state.photoPermission == 'undetermined'?
77 78
           {text: 'OK', onPress: this._requestPermission.bind(this)}
78 79
           : {text: 'Open Settings', onPress: Permissions.openSettings}
79 80
       ]
@@ -108,6 +109,7 @@ Promises resolve into one of these statuses
108 109
 |`reminder`| ✔️ | ❌ |
109 110
 |`notification`| ✔️ | ❌ |
110 111
 |`backgroundRefresh`| ✔️ | ❌ |
112
+|`speechRecognition`| ✔️ | ❌ |
111 113
 
112 114
 ###Methods
113 115
 | Method Name | Arguments | Notes
@@ -152,13 +154,13 @@ All required permissions also need to be included in the Manifest before they ca
152 154
 
153 155
 Permissions are automatically accepted for targetSdkVersion < 23 but you can still use `getPermissionStatus` to check if the user has disabled them from Settings.
154 156
 
155
-Here's a map of types to Android system permissions names:  
156
-`location` -> `android.permission.ACCESS_FINE_LOCATION`  
157
-`camera` -> `android.permission.CAMERA`  
158
-`microphone` -> `android.permission.RECORD_AUDIO`  
159
-`photo` -> `android.permission.READ_EXTERNAL_STORAGE`  
160
-`contacts` -> `android.permission.READ_CONTACTS`  
161
-`event` -> `android.permission.READ_CALENDAR`  
157
+Here's a map of types to Android system permissions names:
158
+`location` -> `android.permission.ACCESS_FINE_LOCATION`
159
+`camera` -> `android.permission.CAMERA`
160
+`microphone` -> `android.permission.RECORD_AUDIO`
161
+`photo` -> `android.permission.READ_EXTERNAL_STORAGE`
162
+`contacts` -> `android.permission.READ_CONTACTS`
163
+`event` -> `android.permission.READ_CALENDAR`
162 164
 
163 165
 You 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
164 166
 
@@ -169,7 +171,7 @@ npm install --save react-native-permissions
169 171
 rnpm link
170 172
 ````
171 173
 
172
-###Or manualy linking   
174
+###Or manualy linking
173 175
 
174 176
 ####iOS
175 177
 * Run open node_modules/react-native-permissions
@@ -221,7 +223,7 @@ public class MainApplication extends Application implements ReactApplication {
221 223
 ##Troubleshooting
222 224
 
223 225
 #### Q: Android - `undefined is not a object (evaluating 'RNPermissions.requestPermissions')`
224
-A: `rnpm` may not have linked correctly. Follow the manual linking steps and make sure the library is linked 
226
+A: `rnpm` may not have linked correctly. Follow the manual linking steps and make sure the library is linked
225 227
 
226 228
 #### Q: iOS - app crashes as soon as I request permission
227 229
 A: starting with xcode 8, you need to add permission descriptions. see iOS notes for more details. Thanks to @jesperlndk for discovering this.