Expoexpo-locationGeolocationReact Native

How to Get the User's Location in Expo (expo-location Guide)

Add geolocation to your Expo app with expo-location — request permissions, get the current position, watch location updates in real time, and reverse-geocode coordinates into an address. SDK 54+ examples.

DeveloperMill2 min read

Maps, ride-sharing, delivery tracking, weather, "find stores near me" — all of them start with the device's location. expo-location is the most-searched way to read GPS coordinates in an Expo app. This guide covers permissions, one-off reads, live tracking, and turning coordinates into an address.

Install

npx expo install expo-location

Add permission copy in app.json:

{
  "expo": {
    "plugins": [
      ["expo-location", {
        "locationAlwaysAndWhenInUsePermission": "Allow $(PRODUCT_NAME) to use your location."
      }]
    ]
  }
}

Request permission and read the current position

import * as Location from "expo-location"
import { useEffect, useState } from "react"
import { Text, View } from "react-native"

export default function Where() {
  const [coords, setCoords] = useState<Location.LocationObjectCoords | null>(null)

  useEffect(() => {
    ;(async () => {
      const { status } = await Location.requestForegroundPermissionsAsync()
      if (status !== "granted") return

      const location = await Location.getCurrentPositionAsync({})
      setCoords(location.coords)
    })()
  }, [])

  return (
    <View>
      <Text>
        {coords ? `${coords.latitude}, ${coords.longitude}` : "Locating…"}
      </Text>
    </View>
  )
}

Control accuracy

Higher accuracy costs battery and takes longer. Pick what your feature needs:

const location = await Location.getCurrentPositionAsync({
  accuracy: Location.Accuracy.Balanced, // Lowest | Low | Balanced | High | Highest
})

Watch location in real time

For live tracking, subscribe with watchPositionAsync and clean up on unmount:

import { useEffect } from "react"

useEffect(() => {
  let subscription: Location.LocationSubscription

  ;(async () => {
    await Location.requestForegroundPermissionsAsync()
    subscription = await Location.watchPositionAsync(
      { accuracy: Location.Accuracy.High, distanceInterval: 10 },
      (loc) => console.log(loc.coords.latitude, loc.coords.longitude)
    )
  })()

  return () => subscription?.remove()
}, [])

Turn coordinates into an address

const [place] = await Location.reverseGeocodeAsync({
  latitude: 37.7749,
  longitude: -122.4194,
})

console.log(place.city, place.region) // "San Francisco", "CA"

Gotchas

  • Foreground vs background: requestForegroundPermissionsAsync covers most apps. Background tracking needs extra permissions and a config plugin, and app-store review scrutiny.
  • Always remove() a watch subscription — leaving it running drains the battery.
  • Simulators let you fake a location (Xcode/Android Studio), which is handy for testing.

Next steps

Pair location with notifications for geo-reminders — see the expo-notifications guide — or cache places offline with expo-sqlite. See everything in the top 10 Expo SDK modules.

Frequently asked questions

How do I get the user's current location in Expo?

Install expo-location, call `Location.requestForegroundPermissionsAsync()` to ask for permission, then `Location.getCurrentPositionAsync({})` to read the latitude and longitude from the returned `coords` object.

How do I track location continuously?

Use `Location.watchPositionAsync(options, callback)`. It streams position updates to your callback as the device moves, and returns a subscription you should remove when the screen unmounts.

Can I turn coordinates into a street address?

Yes. `Location.reverseGeocodeAsync({ latitude, longitude })` returns an array of address objects with fields like city, region, and street — useful for showing a human-readable place name.

Build it faster with a template

Production-ready Expo React Native templates with the patterns from this post already wired up.

Browse templates