浏览代码

shouldShowRequestPermissionRationale is not exposed

Mathieu Acthernoene 8 年之前
父节点
当前提交
883df49822
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      index.android.js

+ 2 - 2
index.android.js

@@ -1,6 +1,6 @@
 // @flow
 
-import { AsyncStorage, PermissionsAndroid } from 'react-native'
+import { AsyncStorage, NativeModules, PermissionsAndroid } from 'react-native'
 
 const permissionTypes = {
   location: PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
@@ -52,7 +52,7 @@ class ReactNativePermissions {
 
       return getDidAskOnce(permission).then(didAsk => {
         if (didAsk) {
-          return PermissionsAndroid.shouldShowRequestPermissionRationale(
+          return NativeModules.PermissionsAndroid.shouldShowRequestPermissionRationale(
             androidPermission,
           ).then(shouldShow => (shouldShow ? 'denied' : 'restricted'))
         }