Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Expo Geolocation with emulator check
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({});
} else {
// Demo location for simulator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.