From 9338fbd7810e8b7b3b0cfe467ca63601b8f43d50 Mon Sep 17 00:00:00 2001 From: Peter Juras Date: Mon, 9 Jan 2017 00:40:29 -0800 Subject: [PATCH] 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 --- Libraries/PermissionsAndroid/PermissionsAndroid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/PermissionsAndroid/PermissionsAndroid.js b/Libraries/PermissionsAndroid/PermissionsAndroid.js index 524bfffb4..1dfdae864 100644 --- a/Libraries/PermissionsAndroid/PermissionsAndroid.js +++ b/Libraries/PermissionsAndroid/PermissionsAndroid.js @@ -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',