Skip to content

Instantly share code, notes, and snippets.

Last active June 18, 2018 18:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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