| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | 26-Sep-2023 | - | ||||
| android/ | H | 26-Sep-2023 | - | 2,585 | 1,991 | |
| build/ | H | 26-Sep-2023 | - | 1,594 | 650 | |
| ios/ | H | 26-Sep-2023 | - | 1,655 | 1,334 | |
| plugin/ | H | 26-Sep-2023 | - | 140 | 127 | |
| src/ | H | 26-Sep-2023 | - | 1,546 | 760 | |
| .eslintrc.js | H A D | 26-Sep-2023 | 103 | 3 | 1 | |
| .gitignore | H A D | 26-Sep-2023 | 12 | 2 | 1 | |
| .npmignore | H A D | 26-Sep-2023 | 183 | 12 | 8 | |
| CHANGELOG.md | H A D | 26-Sep-2023 | 14.9 KiB | 301 | 164 | |
| README.md | H A D | 26-Sep-2023 | 2.7 KiB | 65 | 44 | |
| app.plugin.js | H A D | 26-Sep-2023 | 57 | 2 | 1 | |
| babel.config.js | H A D | 26-Sep-2023 | 104 | 3 | 1 | |
| package.json | H A D | 26-Sep-2023 | 1.2 KiB | 48 | 47 | |
| tsconfig.json | H A D | 26-Sep-2023 | 217 | 10 | 9 | |
| unimodule.json | H A D | 26-Sep-2023 | 65 | 5 | 4 |
README.md
1<p> 2 <a href="https://docs.expo.dev/versions/latest/sdk/location/"> 3 <img 4 src="../../.github/resources/expo-location.svg" 5 alt="expo-location" 6 height="64" /> 7 </a> 8</p> 9 10Allows reading geolocation information from the device. Your app can poll for the current location or subscribe to location update events. 11 12# API documentation 13 14- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/location.mdx) 15- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/location/) 16 17# Installation in managed Expo projects 18 19For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/location/). 20 21# Installation in bare React Native projects 22 23For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing. 24 25### Add the package to your npm dependencies 26 27``` 28npx expo install expo-location 29``` 30 31### Configure for iOS 32 33Add `NSLocationAlwaysAndWhenInUseUsageDescription`, `NSLocationAlwaysUsageDescription` and `NSLocationWhenInUseUsageDescription` keys to your `Info.plist`: 34 35```xml 36<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> 37<string>Allow $(PRODUCT_NAME) to use your location</string> 38<key>NSLocationAlwaysUsageDescription</key> 39<string>Allow $(PRODUCT_NAME) to use your location</string> 40<key>NSLocationWhenInUseUsageDescription</key> 41<string>Allow $(PRODUCT_NAME) to use your location</string> 42``` 43 44Run `npx pod-install` after installing the npm package. 45 46### Configure for Android 47 48This module requires the permissions for approximate and exact device location. It also needs the foreground service permission to subscribe to location updates, while the app is in use. These permissions are automatically added. 49 50```xml 51<!-- Added permissions --> 52<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 53<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 54<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> 55 56<!-- Optional permissions --> 57<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> 58``` 59 60> **Note:** on Android, you have to [submit your app for review and request access to use the background location permission](https://support.google.com/googleplay/android-developer/answer/9799150?hl=en). 61 62# Contributing 63 64Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing). 65