Skip to content

Commit 0537bc3

Browse files
authored
Merge pull request #3 from trestrantham/ios-speech-recognition
Update README
2 parents 3ea5447 + 0414316 commit 0537bc3

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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
###New in version 0.2.X
@@ -51,18 +52,18 @@ const Permissions = require('react-native-permissions');
5152

5253
//check the status of multiple permissions
5354
_checkCameraAndPhotos() {
54-
Permissions.checkMultiplePermissions(['camera', 'photo'])
55+
Permissions.checkMultiplePermissions(['camera', 'photo', 'speechRecognition'])
5556
.then(response => {
5657
//response is an object mapping type to permission
57-
this.setState({
58+
this.setState({
5859
cameraPermission: response.camera,
5960
photoPermission: response.photo,
6061
})
6162
});
6263
}
6364

6465
// 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,
6667
// after which the user needs to manually enable them from settings.
6768
// the idea here is to explain why we need access and determine if
6869
// the user will say no, so that we don't blow our one chance.
@@ -73,7 +74,7 @@ const Permissions = require('react-native-permissions');
7374
'We need access so you can set your profile pic',
7475
[
7576
{text: 'No way', onPress: () => console.log('permission denied'), style: 'cancel'},
76-
this.state.photoPermission == 'undetermined'?
77+
this.state.photoPermission == 'undetermined'?
7778
{text: 'OK', onPress: this._requestPermission.bind(this)}
7879
: {text: 'Open Settings', onPress: Permissions.openSettings}
7980
]
@@ -108,6 +109,7 @@ Promises resolve into one of these statuses
108109
|`reminder`| ✔️ ||
109110
|`notification`| ✔️ ||
110111
|`backgroundRefresh`| ✔️ ||
112+
|`speechRecognition`| ✔️ ||
111113

112114
###Methods
113115
| Method Name | Arguments | Notes
@@ -152,13 +154,13 @@ All required permissions also need to be included in the Manifest before they ca
152154

153155
Permissions are automatically accepted for targetSdkVersion < 23 but you can still use `getPermissionStatus` to check if the user has disabled them from Settings.
154156

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`
162164

163165
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
164166

@@ -169,7 +171,7 @@ npm install --save react-native-permissions
169171
rnpm link
170172
````
171173

172-
###Or manualy linking
174+
###Or manualy linking
173175

174176
####iOS
175177
* Run open node_modules/react-native-permissions
@@ -221,7 +223,7 @@ public class MainApplication extends Application implements ReactApplication {
221223
##Troubleshooting
222224

223225
#### 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
225227

226228
#### Q: iOS - app crashes as soon as I request permission
227229
A: starting with xcode 8, you need to add permission descriptions. see iOS notes for more details. Thanks to @jesperlndk for discovering this.

0 commit comments

Comments
 (0)