Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

expo-location

expo1.1mMIT18.1.5TypeScript support: included

Allows reading geolocation information from the device. Your app can poll for the current location or subscribe to location update events.

react-native, expo, location, geolocation, coords, geocoding, compass, heading

readme

Expo logo

Expo

Expo SDK version Chat or ask a question License: MIT Downloads

Try Expo in the Browser  •  Read the Documentation  •  Learn more on our blog  •  Request a feature

Follow us on

Expo on X   Expo on GitHub   Expo on Reddit   Expo on Bluesky   Expo on LinkedIn

Introduction

Expo is an open-source platform for making universal native apps that run on Android, iOS, and the web. It includes a universal runtime and libraries that let you build native apps by writing React and JavaScript.

This repository includes the Expo SDK, Modules API, Go app, CLI, Router, documentation, and various other supporting tools. Expo Application Services (EAS) is a platform of hosted services that are deeply integrated with Expo open source tools. EAS helps you build, ship, and iterate on your app as an individual or a team.

Read the Expo Community Guidelines before interacting in the repository. Thank you for helping keep the Expo community open and welcoming!

Table of contents

📚 Documentation

Learn about building and deploying universal apps in our official docs!

🗺 Project Layout

  • packages All the source code for Expo modules, if you want to edit a library or just see how it works this is where you'll find it.
  • apps This is where you can find Expo projects which are linked to the development modules. You'll do most of your testing in here.
  • apps/expo-go This is where you can find the source code for Expo Go.
  • apps/expo-go/ios/Exponent.xcworkspace is the Xcode workspace. When developing iOS, always open this instead of Exponent.xcodeproj because the workspace also loads the CocoaPods dependencies.
  • docs The source code for https://docs.expo.dev
  • templates The template projects you get when you run npx create-expo-app
  • react-native-lab This is our fork of react-native used to build Expo Go.
  • guides In-depth tutorials for advanced topics like contributing to the client.
  • tools contain build and configuration tools.
  • template-files contains templates for files that require private keys. They are populated using the keys in template-files/keys.json.
  • template-files/ios/dependencies.json specifies the CocoaPods dependencies of the app.

🏅 Badges

Let everyone know your app can be run instantly in the Expo Go app!

runs with Expo Go

runs with Expo Go

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-000.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

[![runs with Expo Go](https://img.shields.io/badge/Runs%20with%20Expo%20Go-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/client)

👏 Contributing

If you like Expo and want to help make it better then check out our contributing guide! Check out the CLI package to work on the Expo CLI.

❓ FAQ

If you have questions about Expo and want answers, then check out our Frequently Asked Questions!

If you still have questions you can ask them on our Discord and Forums or X @expo.

💙 The Team

Curious about who makes Expo? Here are our team members!

License

The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.

Star the Expo repo on GitHub to support the project

changelog

Changelog

Unpublished

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

18.1.5 — 2025-05-08

🐛 Bug fixes

  • [Android] Fix shouldUseForegroundService being always true. (#35875 by @filipef101)

18.1.4 — 2025-04-30

This version does not introduce any user-facing changes.

18.1.3 — 2025-04-25

This version does not introduce any user-facing changes.

18.1.2 — 2025-04-14

This version does not introduce any user-facing changes.

18.1.1 — 2025-04-09

This version does not introduce any user-facing changes.

18.1.0 — 2025-04-04

🐛 Bug fixes

💡 Others

18.0.10 - 2025-04-01

🐛 Bug fixes

  • [iOS] Fixed issue with some permission request flows resolving too soon on iOS. (#35693 by @chrfalch)
  • [iOS] Remove restarting all services when CLLocationManager reports an error (#35478 by @chrfalch)

18.0.9 - 2025-03-31

This version does not introduce any user-facing changes.

18.0.8 - 2025-03-14

💡 Others

  • On iOS, added setting the scope value as per our documentation. (#35452 by @chrfalch)

18.0.7 - 2025-02-19

🐛 Bug fixes

  • [iOS] Added guards to avoid task options to crash the app. (#35477 by @chrfalch)
  • [iOS] Added error handler to the streaming location/heading methods since these can fail while streaming (#35004 by @chrfalch)

18.0.6 - 2025-02-10

🐛 Bug fixes

  • [Android] Use less specific exception in catch block of resolveUserSettingsForRequest. (#34784 by @alanjhughes)

18.0.5 - 2025-01-10

This version does not introduce any user-facing changes.

18.0.4 - 2024-12-10

This version does not introduce any user-facing changes.

18.0.3 - 2024-11-29

This version does not introduce any user-facing changes.

18.0.2 — 2024-11-19

🐛 Bug fixes

  • Fixed NoClassDefFoundError for Landroid/support/v4/app/ActivityCompat;. (#33088 by @kudo)

18.0.1 — 2024-10-22

This version does not introduce any user-facing changes.

18.0.0 — 2024-10-22

🛠 Breaking changes

  • Remove deprecated code: geocoding using Google Maps API, old permission methods and related types. (#29961 by @Simek)
  • Bumped iOS deployment target to 15.1. (#30840, #30867 by @tsapeta)

🎉 New features

🐛 Bug fixes

  • On iOS, fix an issue where if the user selects "Allow Once" for location permissions, we needed to request background permissions twice because the first time had effect. (#29272 by @alanjhughes)

💡 Others

  • Added warning when using background location in Expo Go. (#31461 by @chrfalch)
  • Keep using the legacy event emitter as the module is not fully migrated to Expo Modules API. (#28946 by @tsapeta)
  • Rework package exports. (#29953 by @Simek)
  • Updated documentation for default LocationAccuracy (#31066 by @johnculviner)

17.0.1 — 2024-04-23

This version does not introduce any user-facing changes.

17.0.0 — 2024-04-18

🛠 Breaking changes

  • [Web] getPermissionsAsync no longer prompts the user for permission instead we use the new browser API navigator.permissions.query to check the permission status. (#26836 by @hems)

🎉 New features

  • Add ability to disable permissions in config plugin by passing false instead of permission messages. (#28107 by @EvanBacon)

💡 Others

16.5.5 - 2024-02-29

This version does not introduce any user-facing changes.

16.5.4 - 2024-02-27

🎉 New features

  • [Android] Make foreground service permission opt-in with isAndroidForegroundServiceEnabled config plugin option #27265 by @brentvatne)
  • [Android] Enable foreground service by default when background location is enabled #27359 by @brentvatne)

16.5.3 - 2024-02-06

🐛 Bug fixes

  • [Android] Fixed: NullPointerException: it must not be null. (#26688 by @lukmccall)
  • On Android, prevent location service from starting when permission is not in the manifest. (#27355 by @alanjhughes)

16.5.2 - 2024-01-10

🎉 New features

🐛 Bug fixes

  • [Android] Fix the module requiring the expo-task-manager module for methods that don't use it. (#26200 by @behenate)

16.5.1 - 2023-12-19

This version does not introduce any user-facing changes.

16.5.0 — 2023-11-14

🛠 Breaking changes

💡 Others

📚 3rd party library updates

  • Updated com.google.android.gms:play-services-location to 21.0.1. (#25028 by @behenate)

16.4.0 — 2023-10-17

🛠 Breaking changes

16.3.0 — 2023-09-04

🎉 New features

  • Added support for React Native 0.73. (#24018 by @kudo)

16.2.1 — 2023-08-02

This version does not introduce any user-facing changes.

16.2.0 — 2023-07-28

This version does not introduce any user-facing changes.

16.1.0 - 2023-07-13

🐛 Bug fixes

16.0.0 — 2023-06-21

This version does not introduce any user-facing changes.

15.3.0 — 2023-06-13

📚 3rd party library updates

  • Updated com.google.android.gms:play-services-location to 21.0.1 and io.nlopez.smartlocation:library to 3.3.3 (#22468 by @josephyanks)

🐛 Bug fixes

💡 Others

  • On Android, removed use of deprecated LocationRequest constructor and replaced with LocationRequest.Builder. (#22653 by @alanjhughes)
  • Removed the Geocoding API service. (#22830 by @alanjhughes)

15.2.0 — 2023-05-08

This version does not introduce any user-facing changes.

15.1.1 — 2023-02-09

This version does not introduce any user-facing changes.

15.1.0 — 2023-02-03

🐛 Bug fixes

💡 Others

  • On Android bump compileSdkVersion and targetSdkVersion to 33. (#20721 by @lukmccall)

15.0.1 — 2022-10-28

This version does not introduce any user-facing changes.

15.0.0 — 2022-10-25

🛠 Breaking changes

  • Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. (#18873 by @tsapeta)

🐛 Bug fixes

  • Fixed trueHeading is sometimes bigger then 360 on Android. (#19629 by @lukmccall)

💡 Others

  • [plugin] Migrate import from @expo/config-plugins to expo/config-plugins and @expo/config-types to expo/config. (#18855 by @brentvatne)
  • Drop @expo/config-plugins dependency in favor of peer dependency on expo. (#18595 by @EvanBacon)

14.3.0 — 2022-07-07

🐛 Bug fixes

  • Fixed Android 12+ runtime crash caused by PendingIntent misconfiguration. (#17333 by @kudo)

14.2.1 — 2022-04-20

This version does not introduce any user-facing changes.

14.2.0 — 2022-04-18

🐛 Bug fixes

⚠️ Notices

  • On Android bump compileSdkVersion to 31, targetSdkVersion to 31 and Java version to 11. (#16941 by @bbarthec)

14.1.0 — 2022-01-26

🐛 Bug fixes

  • Allow location to work on Android with only coarse location permission. All apps do not require fine/precise location permission, but in past Expo was enforcing fine/precise even if you only needed coarse level location. (#15760 by @Noitidart)

Unpublished

🛠 Breaking changes

  • Add an option to whether kill or keep the foreground service when app is killed on Android. (#15633 by @islamouzou)
  • Updated @expo/config-plugins from 4.0.2 to 4.0.14 (#15621 by @EvanBacon)

14.0.2 — 2022-02-01

🐛 Bug fixes

  • Fix Plugin with id 'maven' not found build error from Android Gradle 7. (#16080 by @kudo)

14.0.1 — 2021-12-15

This version does not introduce any user-facing changes.

14.0.0 — 2021-12-03

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

💡 Others

  • Extract nested foregroundService object from LocationTaskOptions type to the separate type LocationTaskServiceOptions. (#14672 by @Simek)

13.0.1 — 2021-10-01

This version does not introduce any user-facing changes.

13.0.0 — 2021-09-28

🛠 Breaking changes

🎉 New features

  • [plugin] Added isIosBackgroundLocationEnabled to enable the background location UIMode (#14142 by @EvanBacon)
  • Use stable manifest ID where applicable. (#12964 by @wschurman)
  • Add useForegroundPermissions and useBackgroundPermissions hooks from modules factory. (#13860 by @bycedric)

🐛 Bug fixes

  • Fixed Location.getCurrentPositionAsync throwing Location provider is unavailable. error. (#14281 by @m1st4ke)
  • Fix building errors from use_frameworks! in Podfile. (#14523 by @kudo)
  • Update error message for LocationUnavailableException on Android. (#14539 by @kylerjensen)

💡 Others

12.1.0 — 2021-06-16

🐛 Bug fixes

  • Fixed startLocationUpdatesAsync requiring the background location permission even if was used when the app is in the foreground on iOS. (#12594 by @lukmccall)
  • Enable kotlin in all modules. (#12716 by @wschurman)

💡 Others

  • Migrated from unimodules-permissions-interface to expo-modules-core. (#12961 by @tsapeta)

12.0.4 — 2021-04-13

This version does not introduce any user-facing changes.

12.0.3 — 2021-04-09

🐛 Bug fixes

  • Add support for user-initiated background tracking without background permission (#12456 by @bycedric)

12.0.2 — 2021-03-29

🐛 Bug fixes

  • Lock the unimodules-permissions-interface dependency to the same version in react-native-unimodules

12.0.1 — 2021-03-26

🐛 Bug fixes

  • Add missing unimodules-permissions-interface dependency

12.0.0 — 2021-03-10

🛠 Breaking changes

  • Splitting location permissions into Foreground and Background permissions. (#12063 by @lukmccall)

🎉 New features

  • Converted plugin to TypeScript. (#11715 by @EvanBacon)
  • Updated Android build configuration to target Android 11 (added support for Android SDK 30). (#11647 by @bbarthec)

🐛 Bug fixes

  • Remove sticky notification on service stop on Android. (#11775 by @zaguiini)
  • Remove peerDependencies and unimodulePeerDependencies from Expo modules. (#11980 by @brentvatne)

11.0.0 — 2021-01-15

⚠️ Notices

🛠 Breaking changes

🎉 New features

🐛 Bug fixes

  • Fixed background location permission check on Android. (#11399 by @peterdn)

10.0.0 — 2020-11-17

🛠 Breaking changes

  • Make background location an opt-in permission on Android. (#10989 by @bycedric)

9.0.1 — 2020-10-02

🐛 Bug fixes

9.0.0 — 2020-08-18

🛠 Breaking changes

  • Add scope field in returned value to indicate whether background permissions are granted. Add android.accuracy field to determine whether coarse or fine location permission is granted. (#9446 by @mczernek)
  • getLastKnownPositionAsync no longer rejects when the last known location is not available – now it returns null. (#9251 by @tsapeta)
  • Removed the deprecated enableHighAccuracy option of getCurrentPositionAsync. (#9251 by @tsapeta)
  • Removed maximumAge and timeout options from getCurrentPositionAsync – it's been Android only and the same behavior can be achieved on all platforms on the JavaScript side. (#9251 by @tsapeta)
  • Made type and enum names more consistent and in line with our standards — they all are now prefixed by Location. The most common ones are still accessible without the prefix, but it's not the recommended way. (#9251 by @tsapeta)
  • geocodeAsync and reverseGeocodeAsync no longer falls back to Google Maps API on Android. (#9444 by @tsapeta)

🎉 New features

  • Added missing altitudeAccuracy to the location object on Android (requires at least Android 8.0). (#9251 by @tsapeta)
  • Improved support for Web — added missing methods for requesting permissions and getting last known position. (#9251 by @tsapeta)
  • Added maxAge and requiredAccuracy options to getLastKnownPositionAsync. (#9251 by @tsapeta)
  • Google Maps Geocoding API can now be used on all platforms with the new useGoogleMaps option. (#9444 by @tsapeta)
  • Added district, subregion and timezone values to reverse-geocoded address object. (#9444 by @tsapeta)

🐛 Bug fixes

  • Fixed different types being used on Web platform. (#9251 by @tsapeta)
  • getLastKnownPositionAsync no longer requests for the current location on iOS and just returns the last known one as it should be. (#9251 by @tsapeta)
  • Fixed getCurrentPositionAsync not resolving on Android when the lowest accuracy is used. (#9251 by @tsapeta)
  • Fixed LocationGeocodedAddress type to reflect the possibility of receiving null values. (#9444 by @tsapeta)

8.3.0 — 2020-07-16

🐛 Bug fixes

  • Added some safety checks to prevent NullPointerExceptions in background location on Android. (#8864 by @mczernek)
  • Add isoCountryCode to Address type and reverse lookup. (#8913 by @bycedric)
  • Fix geocoding requests not resolving/rejecting on iOS when the app is in the background or inactive state. It makes it possible to use geocoding in such app states, however it's still discouraged. (#9178 by @tsapeta)

8.2.1 — 2020-05-29

This version does not introduce any user-facing changes.

8.2.0 — 2020-05-27

This version does not introduce any user-facing changes.