Browse Source

shouldShowRequestPermissionRationale is not exposed

Mathieu Acthernoene 7 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 View File

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { AsyncStorage, PermissionsAndroid } from 'react-native'
3
+import { AsyncStorage, NativeModules, PermissionsAndroid } from 'react-native'
4
 
4
 
5
 const permissionTypes = {
5
 const permissionTypes = {
6
   location: PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
6
   location: PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
52
 
52
 
53
       return getDidAskOnce(permission).then(didAsk => {
53
       return getDidAskOnce(permission).then(didAsk => {
54
         if (didAsk) {
54
         if (didAsk) {
55
-          return PermissionsAndroid.shouldShowRequestPermissionRationale(
55
+          return NativeModules.PermissionsAndroid.shouldShowRequestPermissionRationale(
56
             androidPermission,
56
             androidPermission,
57
           ).then(shouldShow => (shouldShow ? 'denied' : 'restricted'))
57
           ).then(shouldShow => (shouldShow ? 'denied' : 'restricted'))
58
         }
58
         }