expo-location 18.1.5 → 18.1.6-canary-20250611-f0afe80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -1
- package/android/build.gradle +2 -2
- package/build/Location.d.ts +2 -2
- package/build/Location.js +3 -3
- package/build/Location.js.map +1 -1
- package/expo-module.config.json +7 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.module +110 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.pom +47 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.6-canary-20250611-f0afe80/expo.modules.location-18.1.6-canary-20250611-f0afe80.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml +13 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.sha512 +1 -0
- package/package.json +4 -5
- package/src/Location.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
- Remove "Please" from warnings and errors ([#36862](https://github.com/expo/expo/pull/36862) by [@brentvatne](https://github.com/brentvatne))
|
|
14
|
+
|
|
13
15
|
## 18.1.5 — 2025-05-08
|
|
14
16
|
|
|
15
17
|
### 🐛 Bug fixes
|
|
@@ -445,7 +447,7 @@ _This version does not introduce any user-facing changes._
|
|
|
445
447
|
- 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](https://github.com/expo/expo/pull/9446) by [@mczernek](https://github.com/mczernek))
|
|
446
448
|
- `getLastKnownPositionAsync` no longer rejects when the last known location is not available – now it returns `null`. ([#9251](https://github.com/expo/expo/pull/9251) by [@tsapeta](https://github.com/tsapeta))
|
|
447
449
|
- Removed the deprecated `enableHighAccuracy` option of `getCurrentPositionAsync`. ([#9251](https://github.com/expo/expo/pull/9251) by [@tsapeta](https://github.com/tsapeta))
|
|
448
|
-
- Removed `maximumAge` and `timeout` options from `getCurrentPositionAsync` –
|
|
450
|
+
- 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](https://github.com/expo/expo/pull/9251) by [@tsapeta](https://github.com/tsapeta))
|
|
449
451
|
- 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](https://github.com/expo/expo/pull/9251) by [@tsapeta](https://github.com/tsapeta))
|
|
450
452
|
- `geocodeAsync` and `reverseGeocodeAsync` no longer falls back to Google Maps API on Android. ([#9444](https://github.com/expo/expo/pull/9444) by [@tsapeta](https://github.com/tsapeta))
|
|
451
453
|
|
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '18.1.
|
|
7
|
+
version = '18.1.6-canary-20250611-f0afe80'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.location"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 29
|
|
13
|
-
versionName "18.1.
|
|
13
|
+
versionName "18.1.6-canary-20250611-f0afe80"
|
|
14
14
|
consumerProguardFiles("proguard-rules.pro")
|
|
15
15
|
}
|
|
16
16
|
}
|
package/build/Location.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ export declare function getCurrentPositionAsync(options?: LocationOptions): Prom
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function getLastKnownPositionAsync(options?: LocationLastKnownOptions): Promise<LocationObject | null>;
|
|
38
38
|
/**
|
|
39
|
-
* Subscribe to location updates from the device.
|
|
40
|
-
*
|
|
39
|
+
* Subscribe to location updates from the device. Updates will only occur while the application is in
|
|
40
|
+
* the foreground. To get location updates while in background you'll need to use
|
|
41
41
|
* [`startLocationUpdatesAsync`](#locationstartlocationupdatesasynctaskname-options).
|
|
42
42
|
* @param options
|
|
43
43
|
* @param callback This function is called on each location update. It receives an object of type
|
package/build/Location.js
CHANGED
|
@@ -60,8 +60,8 @@ export async function getLastKnownPositionAsync(options = {}) {
|
|
|
60
60
|
}
|
|
61
61
|
// @needsAudit
|
|
62
62
|
/**
|
|
63
|
-
* Subscribe to location updates from the device.
|
|
64
|
-
*
|
|
63
|
+
* Subscribe to location updates from the device. Updates will only occur while the application is in
|
|
64
|
+
* the foreground. To get location updates while in background you'll need to use
|
|
65
65
|
* [`startLocationUpdatesAsync`](#locationstartlocationupdatesasynctaskname-options).
|
|
66
66
|
* @param options
|
|
67
67
|
* @param callback This function is called on each location update. It receives an object of type
|
|
@@ -283,7 +283,7 @@ function _validate(taskName) {
|
|
|
283
283
|
const message = 'Background location is limited in Expo Go:\n' +
|
|
284
284
|
'On Android, it is not available at all.\n' +
|
|
285
285
|
'On iOS, it works when running in the Simulator.\n' +
|
|
286
|
-
'
|
|
286
|
+
'You can use this API, and all others, in a development build. Learn more: https://expo.fyi/dev-client.';
|
|
287
287
|
console.warn(message);
|
|
288
288
|
warnAboutExpoGoDisplayed = true;
|
|
289
289
|
}
|
package/build/Location.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Location.js","sourceRoot":"","sources":["../src/Location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAsB,oBAAoB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEvF,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAEL,gBAAgB,GAcjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,4EAA4E;AAC5E,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,OAAO,YAAY,CAAC,sBAAsB,EAAE,CAAC;AAC/C,CAAC;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,kFAAkF;IAClF,qGAAqG;IACrG,+GAA+G;IAC/G,wFAAwF;IAExF,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,YAAY,CAAC,0BAA0B,EAAE,CAAC;IACnD,CAAC;AACH,CAAC;AAED,cAAc;AACd;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,UAA2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AM,YAAY,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,MAAM,YAAY,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,QAAgB;IAC9D,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,OAAO,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport { PermissionResponse, createPermissionHook, Platform } from 'expo-modules-core';\n\nimport ExpoLocation from './ExpoLocation';\nimport {\n LocationErrorCallback,\n LocationAccuracy,\n LocationCallback,\n LocationGeocodedAddress,\n LocationGeocodedLocation,\n LocationHeadingCallback,\n LocationHeadingObject,\n LocationLastKnownOptions,\n LocationObject,\n LocationOptions,\n LocationPermissionResponse,\n LocationProviderStatus,\n LocationRegion,\n LocationSubscription,\n LocationTaskOptions,\n} from './Location.types';\nimport {\n LocationSubscriber,\n HeadingSubscriber,\n LocationErrorSubscriber,\n} from './LocationSubscribers';\n\n// Flag for warning about background services not being available in Expo Go\nlet warnAboutExpoGoDisplayed = false;\n\n// @needsAudit\n/**\n * Check status of location providers.\n * @return A promise which fulfills with an object of type [`LocationProviderStatus`](#locationproviderstatus).\n */\nexport async function getProviderStatusAsync(): Promise<LocationProviderStatus> {\n return ExpoLocation.getProviderStatusAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to turn on high accuracy location mode which enables network provider that uses\n * Google Play services to improve location accuracy and location-based services.\n * @return A promise resolving as soon as the user accepts the dialog. Rejects if denied.\n *\n * @platform android\n */\nexport async function enableNetworkProviderAsync(): Promise<void> {\n // If network provider is disabled (user's location mode is set to \"Device only\"),\n // Android's location provider may not give you any results. Use this method in order to ask the user\n // to change the location mode to \"High accuracy\" which uses Google Play services and enables network provider.\n // `getCurrentPositionAsync` and `watchPositionAsync` are doing it automatically anyway.\n\n if (Platform.OS === 'android') {\n return ExpoLocation.enableNetworkProviderAsync();\n }\n}\n\n// @needsAudit\n/**\n * Requests for one-time delivery of the user's current location.\n * Depending on given `accuracy` option it may take some time to resolve,\n * especially when you're inside a building.\n * > __Note:__ Calling it causes the location manager to obtain a location fix which may take several\n * > seconds. Consider using [`getLastKnownPositionAsync`](#locationgetlastknownpositionasyncoptions)\n * > if you expect to get a quick response and high accuracy is not required.\n * @param options\n * @return A promise which fulfills with an object of type [`LocationObject`](#locationobject).\n */\nexport async function getCurrentPositionAsync(\n options: LocationOptions = {}\n): Promise<LocationObject> {\n return ExpoLocation.getCurrentPositionAsync(options);\n}\n\n// @needsAudit\n/**\n * Gets the last known position of the device or `null` if it's not available or doesn't match given\n * requirements such as maximum age or required accuracy.\n * It's considered to be faster than `getCurrentPositionAsync` as it doesn't request for the current\n * location, but keep in mind the returned location may not be up-to-date.\n * @param options\n * @return A promise which fulfills with an object of type [`LocationObject`](#locationobject) or\n * `null` if it's not available or doesn't match given requirements such as maximum age or required\n * accuracy.\n */\nexport async function getLastKnownPositionAsync(\n options: LocationLastKnownOptions = {}\n): Promise<LocationObject | null> {\n return ExpoLocation.getLastKnownPositionAsync(options);\n}\n\n// @needsAudit\n/**\n * Subscribe to location updates from the device. Please note that updates will only occur while the\n * application is in the foreground. To get location updates while in background you'll need to use\n * [`startLocationUpdatesAsync`](#locationstartlocationupdatesasynctaskname-options).\n * @param options\n * @param callback This function is called on each location update. It receives an object of type\n * [`LocationObject`](#locationobject) as the first argument.\n * @param errorHandler This function is called when an error occurs. It receives a string with the\n * error message as the first argument.\n * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n */\nexport async function watchPositionAsync(\n options: LocationOptions,\n callback: LocationCallback,\n errorHandler?: LocationErrorCallback\n): Promise<LocationSubscription> {\n const watchId = LocationSubscriber.registerCallback(callback);\n errorHandler && LocationErrorSubscriber.registerCallbackForId(watchId, errorHandler);\n\n await ExpoLocation.watchPositionImplAsync(watchId, options);\n\n return {\n remove() {\n LocationSubscriber.unregisterCallback(watchId);\n errorHandler && LocationErrorSubscriber.unregisterCallback(watchId);\n },\n };\n}\n\n// @needsAudit\n/**\n * Gets the current heading information from the device. To simplify, it calls `watchHeadingAsync`\n * and waits for a couple of updates, and then returns the one that is accurate enough.\n * @return A promise which fulfills with an object of type [`LocationHeadingObject`](#locationheadingobject).\n */\nexport async function getHeadingAsync(): Promise<LocationHeadingObject> {\n return new Promise(async (resolve, reject) => {\n let tries = 0;\n let subscriber: LocationSubscription | undefined = undefined;\n\n try {\n subscriber = await watchHeadingAsync(\n (heading) => {\n if (heading.accuracy > 1 || tries > 5) {\n subscriber?.remove();\n resolve(heading);\n } else {\n tries += 1;\n }\n },\n (reason) => {\n subscriber?.remove();\n reject(reason);\n }\n );\n } catch (e) {\n reject(e);\n }\n });\n}\n\n// @needsAudit\n/**\n * Subscribe to compass updates from the device.\n *\n * @param callback This function is called on each compass update. It receives an object of type\n * [LocationHeadingObject](#locationheadingobject) as the first argument.\n * @param errorHandler This function is called when an error occurs. It receives a string with the\n * error message as the first argument.\n * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n *\n * @platform android\n * @platform ios\n */\nexport async function watchHeadingAsync(\n callback: LocationHeadingCallback,\n errorHandler?: LocationErrorCallback\n): Promise<LocationSubscription> {\n const watchId = HeadingSubscriber.registerCallback(callback);\n errorHandler && LocationErrorSubscriber.registerCallbackForId(watchId, errorHandler);\n\n await ExpoLocation.watchDeviceHeading(watchId);\n\n return {\n remove() {\n HeadingSubscriber.unregisterCallback(watchId);\n errorHandler && LocationErrorSubscriber.unregisterCallback(watchId);\n },\n };\n}\n\n// @needsAudit\n/**\n * Geocode an address string to latitude-longitude location.\n *\n * On Android, you must request location permissions with [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync)\n * before geocoding can be used.\n *\n * > **Note**: Geocoding is resource consuming and has to be used reasonably. Creating too many\n * > requests at a time can result in an error, so they have to be managed properly.\n * > It's also discouraged to use geocoding while the app is in the background and its results won't\n * > be shown to the user immediately.\n *\n * @param address A string representing address, eg. `\"Baker Street London\"`.\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedLocation`](#locationgeocodedlocation)\n * objects.\n *\n * @platform android\n * @platform ios\n */\nexport async function geocodeAsync(address: string): Promise<LocationGeocodedLocation[]> {\n if (typeof address !== 'string') {\n throw new TypeError(`Address to geocode must be a string. Got ${address} instead.`);\n }\n\n if (Platform.OS === 'web') {\n if (__DEV__) {\n console.warn(\n 'The Geocoding API has been removed in SDK 49, use Place Autocomplete service instead' +\n '(https://developers.google.com/maps/documentation/places/web-service/autocomplete)'\n );\n }\n return [];\n }\n\n return await ExpoLocation.geocodeAsync(address);\n}\n\n// @needsAudit\n/**\n * Reverse geocode a location to postal address.\n *\n * On Android, you must request location permissions with [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync)\n * before geocoding can be used.\n *\n * > **Note**: Geocoding is resource consuming and has to be used reasonably. Creating too many\n * > requests at a time can result in an error, so they have to be managed properly.\n * > It's also discouraged to use geocoding while the app is in the background and its results won't\n * > be shown to the user immediately.\n *\n * @param location An object representing a location.\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedAddress`](#locationgeocodedaddress) objects.\n *\n * @platform android\n * @platform ios\n */\nexport async function reverseGeocodeAsync(\n location: Pick<LocationGeocodedLocation, 'latitude' | 'longitude'>\n): Promise<LocationGeocodedAddress[]> {\n if (typeof location.latitude !== 'number' || typeof location.longitude !== 'number') {\n throw new TypeError(\n 'Location to reverse-geocode must be an object with number properties `latitude` and `longitude`.'\n );\n }\n\n if (Platform.OS === 'web') {\n if (__DEV__) {\n console.warn(\n 'The Geocoding API has been removed in SDK 49, use Place Autocomplete service instead' +\n '(https://developers.google.com/maps/documentation/places/web-service/autocomplete)'\n );\n }\n return [];\n }\n\n return await ExpoLocation.reverseGeocodeAsync(location);\n}\n\n// @needsAudit\n/**\n * Checks user's permissions for accessing location while the app is in the foreground.\n * @return A promise that fulfills with an object of type [`LocationPermissionResponse`](#locationpermissionresponse).\n */\nexport async function getForegroundPermissionsAsync(): Promise<LocationPermissionResponse> {\n return await ExpoLocation.getForegroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to grant permissions for location while the app is in the foreground.\n * @return A promise that fulfills with an object of type [`LocationPermissionResponse`](#locationpermissionresponse).\n */\nexport async function requestForegroundPermissionsAsync(): Promise<LocationPermissionResponse> {\n return await ExpoLocation.requestForegroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Check or request permissions for the foreground location.\n * This uses both `requestForegroundPermissionsAsync` and `getForegroundPermissionsAsync` to interact with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Location.useForegroundPermissions();\n * ```\n */\nexport const useForegroundPermissions = createPermissionHook({\n getMethod: getForegroundPermissionsAsync,\n requestMethod: requestForegroundPermissionsAsync,\n});\n\n// @needsAudit\n/**\n * Checks user's permissions for accessing location while the app is in the background.\n * @return A promise that fulfills with an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport async function getBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return await ExpoLocation.getBackgroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to grant permissions for location while the app is in the background.\n * On __Android 11 or higher__: this method will open the system settings page - before that happens\n * you should explain to the user why your application needs background location permission.\n * For example, you can use `Modal` component from `react-native` to do that.\n * > __Note__: Foreground permissions should be granted before asking for the background permissions\n * (your app can't obtain background permission without foreground permission).\n * @return A promise that fulfills with an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport async function requestBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return await ExpoLocation.requestBackgroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Check or request permissions for the background location.\n * This uses both `requestBackgroundPermissionsAsync` and `getBackgroundPermissionsAsync` to\n * interact with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Location.useBackgroundPermissions();\n * ```\n */\nexport const useBackgroundPermissions = createPermissionHook({\n getMethod: getBackgroundPermissionsAsync,\n requestMethod: requestBackgroundPermissionsAsync,\n});\n\n// --- Location service\n\n// @needsAudit\n/**\n * Checks whether location services are enabled by the user.\n * @return A promise which fulfills to `true` if location services are enabled on the device,\n * or `false` if not.\n */\nexport async function hasServicesEnabledAsync(): Promise<boolean> {\n return await ExpoLocation.hasServicesEnabledAsync();\n}\n\n// --- Background location updates\n\nfunction _validate(taskName: string) {\n if (!taskName || typeof taskName !== 'string') {\n throw new Error(`\\`taskName\\` must be a non-empty string. Got ${taskName} instead.`);\n }\n if (isRunningInExpoGo()) {\n if (!warnAboutExpoGoDisplayed) {\n const message =\n 'Background location is limited in Expo Go:\\n' +\n 'On Android, it is not available at all.\\n' +\n 'On iOS, it works when running in the Simulator.\\n' +\n 'Please use a development build to avoid limitations. Learn more: https://expo.fyi/dev-client.';\n console.warn(message);\n warnAboutExpoGoDisplayed = true;\n }\n }\n}\n\n// @docsMissing\nexport async function isBackgroundLocationAvailableAsync(): Promise<boolean> {\n const providerStatus = await getProviderStatusAsync();\n return providerStatus.backgroundModeEnabled;\n}\n\n// @needsAudit\n/**\n * Registers for receiving location updates that can also come when the app is in the background.\n *\n * # Task parameters\n *\n * Background location task will be receiving following data:\n * - `locations` - An array of the new locations.\n *\n * @example\n * ```ts\n * import * as TaskManager from 'expo-task-manager';\n *\n * TaskManager.defineTask(YOUR_TASK_NAME, ({ data: { locations }, error }) => {\n * if (error) {\n * // check `error.message` for more details.\n * return;\n * }\n * console.log('Received new locations', locations);\n * });\n * ```\n *\n * @param taskName Name of the task receiving location updates.\n * @param options An object of options passed to the location manager.\n *\n * @return A promise resolving once the task with location updates is registered.\n */\nexport async function startLocationUpdatesAsync(\n taskName: string,\n options: LocationTaskOptions = { accuracy: LocationAccuracy.Balanced }\n): Promise<void> {\n _validate(taskName);\n await ExpoLocation.startLocationUpdatesAsync(taskName, options);\n}\n\n// @needsAudit\n/**\n * Stops location updates for specified task.\n * @param taskName Name of the background location task to stop.\n * @return A promise resolving as soon as the task is unregistered.\n */\nexport async function stopLocationUpdatesAsync(taskName: string): Promise<void> {\n _validate(taskName);\n await ExpoLocation.stopLocationUpdatesAsync(taskName);\n}\n\n// @needsAudit\n/**\n * @param taskName Name of the location task to check.\n * @return A promise which fulfills with boolean value indicating whether the location task is\n * started or not.\n */\nexport async function hasStartedLocationUpdatesAsync(taskName: string): Promise<boolean> {\n _validate(taskName);\n return ExpoLocation.hasStartedLocationUpdatesAsync(taskName);\n}\n\n// --- Geofencing\n\nfunction _validateRegions(regions: LocationRegion[]) {\n if (!regions || regions.length === 0) {\n throw new Error(\n 'Regions array cannot be empty. Use `stopGeofencingAsync` if you want to stop geofencing all regions'\n );\n }\n for (const region of regions) {\n if (typeof region.latitude !== 'number') {\n throw new TypeError(`Region's latitude must be a number. Got '${region.latitude}' instead.`);\n }\n if (typeof region.longitude !== 'number') {\n throw new TypeError(\n `Region's longitude must be a number. Got '${region.longitude}' instead.`\n );\n }\n if (typeof region.radius !== 'number') {\n throw new TypeError(`Region's radius must be a number. Got '${region.radius}' instead.`);\n }\n }\n}\n\n// @needsAudit\n/**\n * Starts geofencing for given regions. When the new event comes, the task with specified name will\n * be called with the region that the device enter to or exit from.\n * If you want to add or remove regions from already running geofencing task, you can just call\n * `startGeofencingAsync` again with the new array of regions.\n *\n * # Task parameters\n *\n * Geofencing task will be receiving following data:\n * - `eventType` - Indicates the reason for calling the task, which can be triggered by entering or exiting the region.\n * See [`GeofencingEventType`](#geofencingeventtype).\n * - `region` - Object containing details about updated region. See [`LocationRegion`](#locationregion) for more details.\n *\n * @param taskName Name of the task that will be called when the device enters or exits from specified regions.\n * @param regions Array of region objects to be geofenced.\n *\n * @return A promise resolving as soon as the task is registered.\n *\n * @example\n * ```ts\n * import { GeofencingEventType } from 'expo-location';\n * import * as TaskManager from 'expo-task-manager';\n *\n * TaskManager.defineTask(YOUR_TASK_NAME, ({ data: { eventType, region }, error }) => {\n * if (error) {\n * // check `error.message` for more details.\n * return;\n * }\n * if (eventType === GeofencingEventType.Enter) {\n * console.log(\"You've entered region:\", region);\n * } else if (eventType === GeofencingEventType.Exit) {\n * console.log(\"You've left region:\", region);\n * }\n * });\n * ```\n */\nexport async function startGeofencingAsync(\n taskName: string,\n regions: LocationRegion[] = []\n): Promise<void> {\n _validate(taskName);\n _validateRegions(regions);\n await ExpoLocation.startGeofencingAsync(taskName, { regions });\n}\n\n// @needsAudit\n/**\n * Stops geofencing for specified task. It unregisters the background task so the app will not be\n * receiving any updates, especially in the background.\n * @param taskName Name of the task to unregister.\n * @return A promise resolving as soon as the task is unregistered.\n */\nexport async function stopGeofencingAsync(taskName: string): Promise<void> {\n _validate(taskName);\n await ExpoLocation.stopGeofencingAsync(taskName);\n}\n\n// @needsAudit\n/**\n * @param taskName Name of the geofencing task to check.\n * @return A promise which fulfills with boolean value indicating whether the geofencing task is\n * started or not.\n */\nexport async function hasStartedGeofencingAsync(taskName: string): Promise<boolean> {\n _validate(taskName);\n return ExpoLocation.hasStartedGeofencingAsync(taskName);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Location.js","sourceRoot":"","sources":["../src/Location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAsB,oBAAoB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEvF,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAEL,gBAAgB,GAcjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,4EAA4E;AAC5E,IAAI,wBAAwB,GAAG,KAAK,CA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,CACjB,6CAA6C,MAAM,CAAC,SAAS,YAAY,CAC1E,CAAC;QACJ,CAAC;QACD,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,SAAS,CAAC,0CAA0C,MAAM,CAAC,MAAM,YAAY,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;AACH,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,UAA4B,EAAE;IAE9B,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1B,MAAM,YAAY,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AACjE,CAAC;AAED,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,MAAM,YAAY,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,QAAgB;IAC9D,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpB,OAAO,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport { PermissionResponse, createPermissionHook, Platform } from 'expo-modules-core';\n\nimport ExpoLocation from './ExpoLocation';\nimport {\n LocationErrorCallback,\n LocationAccuracy,\n LocationCallback,\n LocationGeocodedAddress,\n LocationGeocodedLocation,\n LocationHeadingCallback,\n LocationHeadingObject,\n LocationLastKnownOptions,\n LocationObject,\n LocationOptions,\n LocationPermissionResponse,\n LocationProviderStatus,\n LocationRegion,\n LocationSubscription,\n LocationTaskOptions,\n} from './Location.types';\nimport {\n LocationSubscriber,\n HeadingSubscriber,\n LocationErrorSubscriber,\n} from './LocationSubscribers';\n\n// Flag for warning about background services not being available in Expo Go\nlet warnAboutExpoGoDisplayed = false;\n\n// @needsAudit\n/**\n * Check status of location providers.\n * @return A promise which fulfills with an object of type [`LocationProviderStatus`](#locationproviderstatus).\n */\nexport async function getProviderStatusAsync(): Promise<LocationProviderStatus> {\n return ExpoLocation.getProviderStatusAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to turn on high accuracy location mode which enables network provider that uses\n * Google Play services to improve location accuracy and location-based services.\n * @return A promise resolving as soon as the user accepts the dialog. Rejects if denied.\n *\n * @platform android\n */\nexport async function enableNetworkProviderAsync(): Promise<void> {\n // If network provider is disabled (user's location mode is set to \"Device only\"),\n // Android's location provider may not give you any results. Use this method in order to ask the user\n // to change the location mode to \"High accuracy\" which uses Google Play services and enables network provider.\n // `getCurrentPositionAsync` and `watchPositionAsync` are doing it automatically anyway.\n\n if (Platform.OS === 'android') {\n return ExpoLocation.enableNetworkProviderAsync();\n }\n}\n\n// @needsAudit\n/**\n * Requests for one-time delivery of the user's current location.\n * Depending on given `accuracy` option it may take some time to resolve,\n * especially when you're inside a building.\n * > __Note:__ Calling it causes the location manager to obtain a location fix which may take several\n * > seconds. Consider using [`getLastKnownPositionAsync`](#locationgetlastknownpositionasyncoptions)\n * > if you expect to get a quick response and high accuracy is not required.\n * @param options\n * @return A promise which fulfills with an object of type [`LocationObject`](#locationobject).\n */\nexport async function getCurrentPositionAsync(\n options: LocationOptions = {}\n): Promise<LocationObject> {\n return ExpoLocation.getCurrentPositionAsync(options);\n}\n\n// @needsAudit\n/**\n * Gets the last known position of the device or `null` if it's not available or doesn't match given\n * requirements such as maximum age or required accuracy.\n * It's considered to be faster than `getCurrentPositionAsync` as it doesn't request for the current\n * location, but keep in mind the returned location may not be up-to-date.\n * @param options\n * @return A promise which fulfills with an object of type [`LocationObject`](#locationobject) or\n * `null` if it's not available or doesn't match given requirements such as maximum age or required\n * accuracy.\n */\nexport async function getLastKnownPositionAsync(\n options: LocationLastKnownOptions = {}\n): Promise<LocationObject | null> {\n return ExpoLocation.getLastKnownPositionAsync(options);\n}\n\n// @needsAudit\n/**\n * Subscribe to location updates from the device. Updates will only occur while the application is in\n * the foreground. To get location updates while in background you'll need to use\n * [`startLocationUpdatesAsync`](#locationstartlocationupdatesasynctaskname-options).\n * @param options\n * @param callback This function is called on each location update. It receives an object of type\n * [`LocationObject`](#locationobject) as the first argument.\n * @param errorHandler This function is called when an error occurs. It receives a string with the\n * error message as the first argument.\n * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n */\nexport async function watchPositionAsync(\n options: LocationOptions,\n callback: LocationCallback,\n errorHandler?: LocationErrorCallback\n): Promise<LocationSubscription> {\n const watchId = LocationSubscriber.registerCallback(callback);\n errorHandler && LocationErrorSubscriber.registerCallbackForId(watchId, errorHandler);\n\n await ExpoLocation.watchPositionImplAsync(watchId, options);\n\n return {\n remove() {\n LocationSubscriber.unregisterCallback(watchId);\n errorHandler && LocationErrorSubscriber.unregisterCallback(watchId);\n },\n };\n}\n\n// @needsAudit\n/**\n * Gets the current heading information from the device. To simplify, it calls `watchHeadingAsync`\n * and waits for a couple of updates, and then returns the one that is accurate enough.\n * @return A promise which fulfills with an object of type [`LocationHeadingObject`](#locationheadingobject).\n */\nexport async function getHeadingAsync(): Promise<LocationHeadingObject> {\n return new Promise(async (resolve, reject) => {\n let tries = 0;\n let subscriber: LocationSubscription | undefined = undefined;\n\n try {\n subscriber = await watchHeadingAsync(\n (heading) => {\n if (heading.accuracy > 1 || tries > 5) {\n subscriber?.remove();\n resolve(heading);\n } else {\n tries += 1;\n }\n },\n (reason) => {\n subscriber?.remove();\n reject(reason);\n }\n );\n } catch (e) {\n reject(e);\n }\n });\n}\n\n// @needsAudit\n/**\n * Subscribe to compass updates from the device.\n *\n * @param callback This function is called on each compass update. It receives an object of type\n * [LocationHeadingObject](#locationheadingobject) as the first argument.\n * @param errorHandler This function is called when an error occurs. It receives a string with the\n * error message as the first argument.\n * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n *\n * @platform android\n * @platform ios\n */\nexport async function watchHeadingAsync(\n callback: LocationHeadingCallback,\n errorHandler?: LocationErrorCallback\n): Promise<LocationSubscription> {\n const watchId = HeadingSubscriber.registerCallback(callback);\n errorHandler && LocationErrorSubscriber.registerCallbackForId(watchId, errorHandler);\n\n await ExpoLocation.watchDeviceHeading(watchId);\n\n return {\n remove() {\n HeadingSubscriber.unregisterCallback(watchId);\n errorHandler && LocationErrorSubscriber.unregisterCallback(watchId);\n },\n };\n}\n\n// @needsAudit\n/**\n * Geocode an address string to latitude-longitude location.\n *\n * On Android, you must request location permissions with [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync)\n * before geocoding can be used.\n *\n * > **Note**: Geocoding is resource consuming and has to be used reasonably. Creating too many\n * > requests at a time can result in an error, so they have to be managed properly.\n * > It's also discouraged to use geocoding while the app is in the background and its results won't\n * > be shown to the user immediately.\n *\n * @param address A string representing address, eg. `\"Baker Street London\"`.\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedLocation`](#locationgeocodedlocation)\n * objects.\n *\n * @platform android\n * @platform ios\n */\nexport async function geocodeAsync(address: string): Promise<LocationGeocodedLocation[]> {\n if (typeof address !== 'string') {\n throw new TypeError(`Address to geocode must be a string. Got ${address} instead.`);\n }\n\n if (Platform.OS === 'web') {\n if (__DEV__) {\n console.warn(\n 'The Geocoding API has been removed in SDK 49, use Place Autocomplete service instead' +\n '(https://developers.google.com/maps/documentation/places/web-service/autocomplete)'\n );\n }\n return [];\n }\n\n return await ExpoLocation.geocodeAsync(address);\n}\n\n// @needsAudit\n/**\n * Reverse geocode a location to postal address.\n *\n * On Android, you must request location permissions with [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync)\n * before geocoding can be used.\n *\n * > **Note**: Geocoding is resource consuming and has to be used reasonably. Creating too many\n * > requests at a time can result in an error, so they have to be managed properly.\n * > It's also discouraged to use geocoding while the app is in the background and its results won't\n * > be shown to the user immediately.\n *\n * @param location An object representing a location.\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedAddress`](#locationgeocodedaddress) objects.\n *\n * @platform android\n * @platform ios\n */\nexport async function reverseGeocodeAsync(\n location: Pick<LocationGeocodedLocation, 'latitude' | 'longitude'>\n): Promise<LocationGeocodedAddress[]> {\n if (typeof location.latitude !== 'number' || typeof location.longitude !== 'number') {\n throw new TypeError(\n 'Location to reverse-geocode must be an object with number properties `latitude` and `longitude`.'\n );\n }\n\n if (Platform.OS === 'web') {\n if (__DEV__) {\n console.warn(\n 'The Geocoding API has been removed in SDK 49, use Place Autocomplete service instead' +\n '(https://developers.google.com/maps/documentation/places/web-service/autocomplete)'\n );\n }\n return [];\n }\n\n return await ExpoLocation.reverseGeocodeAsync(location);\n}\n\n// @needsAudit\n/**\n * Checks user's permissions for accessing location while the app is in the foreground.\n * @return A promise that fulfills with an object of type [`LocationPermissionResponse`](#locationpermissionresponse).\n */\nexport async function getForegroundPermissionsAsync(): Promise<LocationPermissionResponse> {\n return await ExpoLocation.getForegroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to grant permissions for location while the app is in the foreground.\n * @return A promise that fulfills with an object of type [`LocationPermissionResponse`](#locationpermissionresponse).\n */\nexport async function requestForegroundPermissionsAsync(): Promise<LocationPermissionResponse> {\n return await ExpoLocation.requestForegroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Check or request permissions for the foreground location.\n * This uses both `requestForegroundPermissionsAsync` and `getForegroundPermissionsAsync` to interact with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Location.useForegroundPermissions();\n * ```\n */\nexport const useForegroundPermissions = createPermissionHook({\n getMethod: getForegroundPermissionsAsync,\n requestMethod: requestForegroundPermissionsAsync,\n});\n\n// @needsAudit\n/**\n * Checks user's permissions for accessing location while the app is in the background.\n * @return A promise that fulfills with an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport async function getBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return await ExpoLocation.getBackgroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to grant permissions for location while the app is in the background.\n * On __Android 11 or higher__: this method will open the system settings page - before that happens\n * you should explain to the user why your application needs background location permission.\n * For example, you can use `Modal` component from `react-native` to do that.\n * > __Note__: Foreground permissions should be granted before asking for the background permissions\n * (your app can't obtain background permission without foreground permission).\n * @return A promise that fulfills with an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport async function requestBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return await ExpoLocation.requestBackgroundPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Check or request permissions for the background location.\n * This uses both `requestBackgroundPermissionsAsync` and `getBackgroundPermissionsAsync` to\n * interact with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Location.useBackgroundPermissions();\n * ```\n */\nexport const useBackgroundPermissions = createPermissionHook({\n getMethod: getBackgroundPermissionsAsync,\n requestMethod: requestBackgroundPermissionsAsync,\n});\n\n// --- Location service\n\n// @needsAudit\n/**\n * Checks whether location services are enabled by the user.\n * @return A promise which fulfills to `true` if location services are enabled on the device,\n * or `false` if not.\n */\nexport async function hasServicesEnabledAsync(): Promise<boolean> {\n return await ExpoLocation.hasServicesEnabledAsync();\n}\n\n// --- Background location updates\n\nfunction _validate(taskName: string) {\n if (!taskName || typeof taskName !== 'string') {\n throw new Error(`\\`taskName\\` must be a non-empty string. Got ${taskName} instead.`);\n }\n if (isRunningInExpoGo()) {\n if (!warnAboutExpoGoDisplayed) {\n const message =\n 'Background location is limited in Expo Go:\\n' +\n 'On Android, it is not available at all.\\n' +\n 'On iOS, it works when running in the Simulator.\\n' +\n 'You can use this API, and all others, in a development build. Learn more: https://expo.fyi/dev-client.';\n console.warn(message);\n warnAboutExpoGoDisplayed = true;\n }\n }\n}\n\n// @docsMissing\nexport async function isBackgroundLocationAvailableAsync(): Promise<boolean> {\n const providerStatus = await getProviderStatusAsync();\n return providerStatus.backgroundModeEnabled;\n}\n\n// @needsAudit\n/**\n * Registers for receiving location updates that can also come when the app is in the background.\n *\n * # Task parameters\n *\n * Background location task will be receiving following data:\n * - `locations` - An array of the new locations.\n *\n * @example\n * ```ts\n * import * as TaskManager from 'expo-task-manager';\n *\n * TaskManager.defineTask(YOUR_TASK_NAME, ({ data: { locations }, error }) => {\n * if (error) {\n * // check `error.message` for more details.\n * return;\n * }\n * console.log('Received new locations', locations);\n * });\n * ```\n *\n * @param taskName Name of the task receiving location updates.\n * @param options An object of options passed to the location manager.\n *\n * @return A promise resolving once the task with location updates is registered.\n */\nexport async function startLocationUpdatesAsync(\n taskName: string,\n options: LocationTaskOptions = { accuracy: LocationAccuracy.Balanced }\n): Promise<void> {\n _validate(taskName);\n await ExpoLocation.startLocationUpdatesAsync(taskName, options);\n}\n\n// @needsAudit\n/**\n * Stops location updates for specified task.\n * @param taskName Name of the background location task to stop.\n * @return A promise resolving as soon as the task is unregistered.\n */\nexport async function stopLocationUpdatesAsync(taskName: string): Promise<void> {\n _validate(taskName);\n await ExpoLocation.stopLocationUpdatesAsync(taskName);\n}\n\n// @needsAudit\n/**\n * @param taskName Name of the location task to check.\n * @return A promise which fulfills with boolean value indicating whether the location task is\n * started or not.\n */\nexport async function hasStartedLocationUpdatesAsync(taskName: string): Promise<boolean> {\n _validate(taskName);\n return ExpoLocation.hasStartedLocationUpdatesAsync(taskName);\n}\n\n// --- Geofencing\n\nfunction _validateRegions(regions: LocationRegion[]) {\n if (!regions || regions.length === 0) {\n throw new Error(\n 'Regions array cannot be empty. Use `stopGeofencingAsync` if you want to stop geofencing all regions'\n );\n }\n for (const region of regions) {\n if (typeof region.latitude !== 'number') {\n throw new TypeError(`Region's latitude must be a number. Got '${region.latitude}' instead.`);\n }\n if (typeof region.longitude !== 'number') {\n throw new TypeError(\n `Region's longitude must be a number. Got '${region.longitude}' instead.`\n );\n }\n if (typeof region.radius !== 'number') {\n throw new TypeError(`Region's radius must be a number. Got '${region.radius}' instead.`);\n }\n }\n}\n\n// @needsAudit\n/**\n * Starts geofencing for given regions. When the new event comes, the task with specified name will\n * be called with the region that the device enter to or exit from.\n * If you want to add or remove regions from already running geofencing task, you can just call\n * `startGeofencingAsync` again with the new array of regions.\n *\n * # Task parameters\n *\n * Geofencing task will be receiving following data:\n * - `eventType` - Indicates the reason for calling the task, which can be triggered by entering or exiting the region.\n * See [`GeofencingEventType`](#geofencingeventtype).\n * - `region` - Object containing details about updated region. See [`LocationRegion`](#locationregion) for more details.\n *\n * @param taskName Name of the task that will be called when the device enters or exits from specified regions.\n * @param regions Array of region objects to be geofenced.\n *\n * @return A promise resolving as soon as the task is registered.\n *\n * @example\n * ```ts\n * import { GeofencingEventType } from 'expo-location';\n * import * as TaskManager from 'expo-task-manager';\n *\n * TaskManager.defineTask(YOUR_TASK_NAME, ({ data: { eventType, region }, error }) => {\n * if (error) {\n * // check `error.message` for more details.\n * return;\n * }\n * if (eventType === GeofencingEventType.Enter) {\n * console.log(\"You've entered region:\", region);\n * } else if (eventType === GeofencingEventType.Exit) {\n * console.log(\"You've left region:\", region);\n * }\n * });\n * ```\n */\nexport async function startGeofencingAsync(\n taskName: string,\n regions: LocationRegion[] = []\n): Promise<void> {\n _validate(taskName);\n _validateRegions(regions);\n await ExpoLocation.startGeofencingAsync(taskName, { regions });\n}\n\n// @needsAudit\n/**\n * Stops geofencing for specified task. It unregisters the background task so the app will not be\n * receiving any updates, especially in the background.\n * @param taskName Name of the task to unregister.\n * @return A promise resolving as soon as the task is unregistered.\n */\nexport async function stopGeofencingAsync(taskName: string): Promise<void> {\n _validate(taskName);\n await ExpoLocation.stopGeofencingAsync(taskName);\n}\n\n// @needsAudit\n/**\n * @param taskName Name of the geofencing task to check.\n * @return A promise which fulfills with boolean value indicating whether the geofencing task is\n * started or not.\n */\nexport async function hasStartedGeofencingAsync(taskName: string): Promise<boolean> {\n _validate(taskName);\n return ExpoLocation.hasStartedGeofencingAsync(taskName);\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
"modules": ["LocationModule"]
|
|
5
5
|
},
|
|
6
6
|
"android": {
|
|
7
|
-
"modules": ["expo.modules.location.LocationModule"]
|
|
7
|
+
"modules": ["expo.modules.location.LocationModule"],
|
|
8
|
+
"publication": {
|
|
9
|
+
"groupId": "host.exp.exponent",
|
|
10
|
+
"artifactId": "expo.modules.location",
|
|
11
|
+
"version": "18.1.6-canary-20250611-f0afe80",
|
|
12
|
+
"repository": "local-maven-repo"
|
|
13
|
+
}
|
|
8
14
|
}
|
|
9
15
|
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7901689a7c34acc7ae8af3462616529e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
92bdf64a7d26f40abe06efdd8a75fb5aea081a5b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6cee5095a2544eab12b9238d3508e6f84472d5d4456f3ae025d2ca0004d5ac9f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ea8ee4997b883d87862e4bf9be7f825c134db18f7bf963e6eef6bc58009fdf681db683d96abd99d8f7e8b3e77668496ff242690db54ea9dd21b67e6f93cd6990
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
34df58c9c8b878ff6a797300b0abc222
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
676b94ff00a227dd6e0dba14c5901baca636d41b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b72a46aa74eefb8b15c5ecd80cc87b346ce74d6f22b09fc8ccad010e675fa551
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2579e79febcd04f010868d3098e205619e28f0b367aac33924668089194b4f30b6d5d9559fbf90a340ebcbe9f190265505ba223dd5c3a0b1bf08d5b7063c6898
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"formatVersion": "1.1",
|
|
3
|
+
"component": {
|
|
4
|
+
"group": "host.exp.exponent",
|
|
5
|
+
"module": "expo.modules.location",
|
|
6
|
+
"version": "18.1.6-canary-20250611-f0afe80",
|
|
7
|
+
"attributes": {
|
|
8
|
+
"org.gradle.status": "release"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"createdBy": {
|
|
12
|
+
"gradle": {
|
|
13
|
+
"version": "8.14"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"variants": [
|
|
17
|
+
{
|
|
18
|
+
"name": "releaseVariantReleaseApiPublication",
|
|
19
|
+
"attributes": {
|
|
20
|
+
"org.gradle.category": "library",
|
|
21
|
+
"org.gradle.dependency.bundling": "external",
|
|
22
|
+
"org.gradle.libraryelements": "aar",
|
|
23
|
+
"org.gradle.usage": "java-api"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": [
|
|
26
|
+
{
|
|
27
|
+
"group": "com.google.android.gms",
|
|
28
|
+
"module": "play-services-location",
|
|
29
|
+
"version": {
|
|
30
|
+
"requires": "21.0.1"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"files": [
|
|
35
|
+
{
|
|
36
|
+
"name": "expo.modules.location-18.1.6-canary-20250611-f0afe80.aar",
|
|
37
|
+
"url": "expo.modules.location-18.1.6-canary-20250611-f0afe80.aar",
|
|
38
|
+
"size": 186509,
|
|
39
|
+
"sha512": "2579e79febcd04f010868d3098e205619e28f0b367aac33924668089194b4f30b6d5d9559fbf90a340ebcbe9f190265505ba223dd5c3a0b1bf08d5b7063c6898",
|
|
40
|
+
"sha256": "b72a46aa74eefb8b15c5ecd80cc87b346ce74d6f22b09fc8ccad010e675fa551",
|
|
41
|
+
"sha1": "676b94ff00a227dd6e0dba14c5901baca636d41b",
|
|
42
|
+
"md5": "34df58c9c8b878ff6a797300b0abc222"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "releaseVariantReleaseRuntimePublication",
|
|
48
|
+
"attributes": {
|
|
49
|
+
"org.gradle.category": "library",
|
|
50
|
+
"org.gradle.dependency.bundling": "external",
|
|
51
|
+
"org.gradle.libraryelements": "aar",
|
|
52
|
+
"org.gradle.usage": "java-runtime"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": [
|
|
55
|
+
{
|
|
56
|
+
"group": "org.jetbrains.kotlin",
|
|
57
|
+
"module": "kotlin-stdlib-jdk7",
|
|
58
|
+
"version": {
|
|
59
|
+
"requires": "2.1.20"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"group": "androidx.annotation",
|
|
64
|
+
"module": "annotation",
|
|
65
|
+
"version": {
|
|
66
|
+
"requires": "1.7.1"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"group": "com.google.android.gms",
|
|
71
|
+
"module": "play-services-location",
|
|
72
|
+
"version": {
|
|
73
|
+
"requires": "21.0.1"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"files": [
|
|
78
|
+
{
|
|
79
|
+
"name": "expo.modules.location-18.1.6-canary-20250611-f0afe80.aar",
|
|
80
|
+
"url": "expo.modules.location-18.1.6-canary-20250611-f0afe80.aar",
|
|
81
|
+
"size": 186509,
|
|
82
|
+
"sha512": "2579e79febcd04f010868d3098e205619e28f0b367aac33924668089194b4f30b6d5d9559fbf90a340ebcbe9f190265505ba223dd5c3a0b1bf08d5b7063c6898",
|
|
83
|
+
"sha256": "b72a46aa74eefb8b15c5ecd80cc87b346ce74d6f22b09fc8ccad010e675fa551",
|
|
84
|
+
"sha1": "676b94ff00a227dd6e0dba14c5901baca636d41b",
|
|
85
|
+
"md5": "34df58c9c8b878ff6a797300b0abc222"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "releaseVariantReleaseSourcePublication",
|
|
91
|
+
"attributes": {
|
|
92
|
+
"org.gradle.category": "documentation",
|
|
93
|
+
"org.gradle.dependency.bundling": "external",
|
|
94
|
+
"org.gradle.docstype": "sources",
|
|
95
|
+
"org.gradle.usage": "java-runtime"
|
|
96
|
+
},
|
|
97
|
+
"files": [
|
|
98
|
+
{
|
|
99
|
+
"name": "expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar",
|
|
100
|
+
"url": "expo.modules.location-18.1.6-canary-20250611-f0afe80-sources.jar",
|
|
101
|
+
"size": 22916,
|
|
102
|
+
"sha512": "ea8ee4997b883d87862e4bf9be7f825c134db18f7bf963e6eef6bc58009fdf681db683d96abd99d8f7e8b3e77668496ff242690db54ea9dd21b67e6f93cd6990",
|
|
103
|
+
"sha256": "6cee5095a2544eab12b9238d3508e6f84472d5d4456f3ae025d2ca0004d5ac9f",
|
|
104
|
+
"sha1": "92bdf64a7d26f40abe06efdd8a75fb5aea081a5b",
|
|
105
|
+
"md5": "7901689a7c34acc7ae8af3462616529e"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b29758fb14c0ecfd6c3fd0203461a4a2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
28638b250bb00ef519b178bcca7044f09f3a2682
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5f21472469597e88e18b08b0784560f56d56c1cc8cf393595d71e977e98edf13
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
488921baa73eb0decdde5a72cc90ff9348769ded660c3fac2a98f0cb3592a2baf210ab7aff67a83775cf834a4d2a54f16fa9488b7a6487a5156d7d4f266f4679
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
4
|
+
<!-- This module was also published with a richer model, Gradle metadata, -->
|
|
5
|
+
<!-- which should be used instead. Do not delete the following line which -->
|
|
6
|
+
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
|
|
7
|
+
<!-- that they should prefer consuming it instead. -->
|
|
8
|
+
<!-- do_not_remove: published-with-gradle-metadata -->
|
|
9
|
+
<modelVersion>4.0.0</modelVersion>
|
|
10
|
+
<groupId>host.exp.exponent</groupId>
|
|
11
|
+
<artifactId>expo.modules.location</artifactId>
|
|
12
|
+
<version>18.1.6-canary-20250611-f0afe80</version>
|
|
13
|
+
<packaging>aar</packaging>
|
|
14
|
+
<name>expo.modules.location</name>
|
|
15
|
+
<url>https://github.com/expo/expo</url>
|
|
16
|
+
<licenses>
|
|
17
|
+
<license>
|
|
18
|
+
<name>MIT License</name>
|
|
19
|
+
<url>https://github.com/expo/expo/blob/main/LICENSE</url>
|
|
20
|
+
</license>
|
|
21
|
+
</licenses>
|
|
22
|
+
<scm>
|
|
23
|
+
<connection>https://github.com/expo/expo.git</connection>
|
|
24
|
+
<developerConnection>https://github.com/expo/expo.git</developerConnection>
|
|
25
|
+
<url>https://github.com/expo/expo</url>
|
|
26
|
+
</scm>
|
|
27
|
+
<dependencies>
|
|
28
|
+
<dependency>
|
|
29
|
+
<groupId>com.google.android.gms</groupId>
|
|
30
|
+
<artifactId>play-services-location</artifactId>
|
|
31
|
+
<version>21.0.1</version>
|
|
32
|
+
<scope>compile</scope>
|
|
33
|
+
</dependency>
|
|
34
|
+
<dependency>
|
|
35
|
+
<groupId>org.jetbrains.kotlin</groupId>
|
|
36
|
+
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
|
37
|
+
<version>2.1.20</version>
|
|
38
|
+
<scope>runtime</scope>
|
|
39
|
+
</dependency>
|
|
40
|
+
<dependency>
|
|
41
|
+
<groupId>androidx.annotation</groupId>
|
|
42
|
+
<artifactId>annotation</artifactId>
|
|
43
|
+
<version>1.7.1</version>
|
|
44
|
+
<scope>runtime</scope>
|
|
45
|
+
</dependency>
|
|
46
|
+
</dependencies>
|
|
47
|
+
</project>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8fadd99a0ac97e2fc86df9ec3bbf4f0e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1bf4d12f7ab8283a8ac64d4168156149095d22bf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ac048faa0ba65d9d2b35c8d2fb4839f18fc58ca48960763dd80358f50ac342cb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
87338456fd1344a689559c356dec263056b4a5d7e66785f2c0410665a948f146c5ead2acbd80458215c55f03cfdab7e9be502b09694c511574ce4a8cdd555628
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<metadata>
|
|
3
|
+
<groupId>host.exp.exponent</groupId>
|
|
4
|
+
<artifactId>expo.modules.location</artifactId>
|
|
5
|
+
<versioning>
|
|
6
|
+
<latest>18.1.6-canary-20250611-f0afe80</latest>
|
|
7
|
+
<release>18.1.6-canary-20250611-f0afe80</release>
|
|
8
|
+
<versions>
|
|
9
|
+
<version>18.1.6-canary-20250611-f0afe80</version>
|
|
10
|
+
</versions>
|
|
11
|
+
<lastUpdated>20250611221448</lastUpdated>
|
|
12
|
+
</versioning>
|
|
13
|
+
</metadata>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4f0d0f18458a117d4a6227061c34c9bf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bc96b98c471034e96d7aaa63b4b5893740602a0c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3e07edc23ff09255ac2b3924cf3da5614b8b0f016894dbcd6b2c0a085a009ebe
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
29aad9a95725512992ed09915ab1d137eb798e95b354c40f60ac5595d090e91d8aabe6329dccc6de91354275b32096f44ce833c930514a7c7a2ce3d23612edc7
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-location",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.6-canary-20250611-f0afe80",
|
|
4
4
|
"description": "Allows reading geolocation information from the device. Your app can poll for the current location or subscribe to location update events.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -39,10 +39,9 @@
|
|
|
39
39
|
"preset": "expo-module-scripts"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"expo-module-scripts": "
|
|
42
|
+
"expo-module-scripts": "4.1.8-canary-20250611-f0afe80"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"expo": "
|
|
46
|
-
}
|
|
47
|
-
"gitHead": "49c9d53cf0a9fc8179d1c8f5268beadd141f70ca"
|
|
45
|
+
"expo": "54.0.0-canary-20250611-f0afe80"
|
|
46
|
+
}
|
|
48
47
|
}
|
package/src/Location.ts
CHANGED
|
@@ -92,8 +92,8 @@ export async function getLastKnownPositionAsync(
|
|
|
92
92
|
|
|
93
93
|
// @needsAudit
|
|
94
94
|
/**
|
|
95
|
-
* Subscribe to location updates from the device.
|
|
96
|
-
*
|
|
95
|
+
* Subscribe to location updates from the device. Updates will only occur while the application is in
|
|
96
|
+
* the foreground. To get location updates while in background you'll need to use
|
|
97
97
|
* [`startLocationUpdatesAsync`](#locationstartlocationupdatesasynctaskname-options).
|
|
98
98
|
* @param options
|
|
99
99
|
* @param callback This function is called on each location update. It receives an object of type
|
|
@@ -355,7 +355,7 @@ function _validate(taskName: string) {
|
|
|
355
355
|
'Background location is limited in Expo Go:\n' +
|
|
356
356
|
'On Android, it is not available at all.\n' +
|
|
357
357
|
'On iOS, it works when running in the Simulator.\n' +
|
|
358
|
-
'
|
|
358
|
+
'You can use this API, and all others, in a development build. Learn more: https://expo.fyi/dev-client.';
|
|
359
359
|
console.warn(message);
|
|
360
360
|
warnAboutExpoGoDisplayed = true;
|
|
361
361
|
}
|