mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 05:34:15 +00:00
Update PermissionsAndroid docs to use new APIs
Summary: It seems that the `requestPermission` and `checkPermission` APIs from PermissionsAndroid have been deprecated in react-native 0.40.0., but they are still used in the description and example. This commit updates the description and the example to use the new APIs. Closes https://github.com/facebook/react-native/pull/11722 Differential Revision: D4392031 Pulled By: ericvicenti fbshipit-source-id: e3ceebb1ef557e05dab40bb883013be4ec80bed6
This commit is contained in:
parent
407973ab27
commit
9338fbd781
@ -29,7 +29,7 @@ type PermissionStatus = 'granted' | 'denied' | 'never_ask_again';
|
||||
* permissions.
|
||||
*
|
||||
* On devices before SDK version 23, the permissions are automatically granted
|
||||
* if they appear in the manifest, so `checkPermission` and `requestPermission`
|
||||
* if they appear in the manifest, so `check` and `request`
|
||||
* should always be true.
|
||||
*
|
||||
* If a user has previously turned off a permission that you prompt for, the OS
|
||||
@ -41,7 +41,7 @@ type PermissionStatus = 'granted' | 'denied' | 'never_ask_again';
|
||||
* ```
|
||||
* async function requestCameraPermission() {
|
||||
* try {
|
||||
* const granted = await PermissionsAndroid.requestPermission(
|
||||
* const granted = await PermissionsAndroid.request(
|
||||
* PermissionsAndroid.PERMISSIONS.CAMERA,
|
||||
* {
|
||||
* 'title': 'Cool Photo App Camera Permission',
|
||||
|
Loading…
x
Reference in New Issue
Block a user