|
|
|
|
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
|
}
|