Browse Source

shouldShowRequestPermissionRationale is not exposed

Mathieu Acthernoene 8 years ago
parent
commit
883df49822
1 changed files with 2 additions and 2 deletions
  1. 2 2
      index.android.js

+ 2 - 2
index.android.js

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