Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const getCurrentLocation = (simulator) => {
- return async (dispatch) => {
- if (!simulator) {
- let { status } = await Permissions.askAsync(Permissions.LOCATION);
- if (status !== 'granted') {
- dispatch(gotCurrentLocationError('Permission to access location was denied'))
- }
- let location = await Location.getCurrentPositionAsync({});
- dispatch(gotCurrentLocation(location))
- } else {
- // Demo location for simulator
- dispatch(gotCurrentLocation(chicagoFSA))
- }
- }
- }
Add Comment
Please, Sign In to add comment