Additional tweaks for permission checks

This commit is contained in:
John Lyon-Smith
2018-04-15 17:50:07 -07:00
parent a4a81cf6ca
commit 6d568efbee
7 changed files with 40 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import {
StyleSheet,
AsyncStorage,
PermissionsAndroid,
Platform,
} from "react-native"
import { NativeRouter, Route, Link, Switch } from "react-router-native"
import MapView from "react-native-maps"
@@ -26,6 +27,13 @@ export const ensurePermission = (
onSuccess,
onError
) => {
if (Platform.OS === "ios") {
if (onSuccess) {
onSuccess()
}
return
}
PermissionsAndroid.check(permission)
.then((flag) => {
if (flag) {