expo-location 18.1.1 → 18.1.3
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 +8 -0
- package/android/build.gradle +2 -2
- package/build/ExpoLocation.web.d.ts +3 -3
- package/build/ExpoLocation.web.d.ts.map +1 -1
- package/build/ExpoLocation.web.js +2 -3
- package/build/ExpoLocation.web.js.map +1 -1
- package/build/GeolocationPolyfill.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1.module → 18.1.3/expo.modules.location-18.1.3.module} +17 -17
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1.pom → 18.1.3/expo.modules.location-18.1.3.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.3/expo.modules.location-18.1.3.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/ExpoLocation.web.ts +6 -7
- package/src/GeolocationPolyfill.ts +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.location/18.1.1/expo.modules.location-18.1.1.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1-sources.jar → 18.1.3/expo.modules.location-18.1.3-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1-sources.jar.md5 → 18.1.3/expo.modules.location-18.1.3-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1-sources.jar.sha1 → 18.1.3/expo.modules.location-18.1.3-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1-sources.jar.sha256 → 18.1.3/expo.modules.location-18.1.3-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.location/{18.1.1/expo.modules.location-18.1.1-sources.jar.sha512 → 18.1.3/expo.modules.location-18.1.3-sources.jar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 18.1.3 — 2025-04-25
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 18.1.2 — 2025-04-14
|
|
18
|
+
|
|
19
|
+
_This version does not introduce any user-facing changes._
|
|
20
|
+
|
|
13
21
|
## 18.1.1 — 2025-04-09
|
|
14
22
|
|
|
15
23
|
_This version does not introduce any user-facing changes._
|
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.3'
|
|
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.3"
|
|
14
14
|
consumerProguardFiles("proguard-rules.pro")
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -6,12 +6,12 @@ declare const _default: {
|
|
|
6
6
|
}>;
|
|
7
7
|
getLastKnownPositionAsync(options?: LocationLastKnownOptions): Promise<LocationObject | null>;
|
|
8
8
|
getCurrentPositionAsync(options: LocationOptions): Promise<LocationObject>;
|
|
9
|
-
removeWatchAsync(watchId:
|
|
10
|
-
watchDeviceHeading(
|
|
9
|
+
removeWatchAsync(watchId: number): Promise<void>;
|
|
10
|
+
watchDeviceHeading(_headingId: number): Promise<void>;
|
|
11
11
|
hasServicesEnabledAsync(): Promise<boolean>;
|
|
12
12
|
geocodeAsync(): Promise<any[]>;
|
|
13
13
|
reverseGeocodeAsync(): Promise<any[]>;
|
|
14
|
-
watchPositionImplAsync(watchId:
|
|
14
|
+
watchPositionImplAsync(watchId: number, options: PositionOptions): Promise<number>;
|
|
15
15
|
requestForegroundPermissionsAsync(): Promise<PermissionResponse>;
|
|
16
16
|
requestBackgroundPermissionsAsync(): Promise<PermissionResponse>;
|
|
17
17
|
getForegroundPermissionsAsync(): Promise<PermissionResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoLocation.web.d.ts","sourceRoot":"","sources":["../src/ExpoLocation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAyC,MAAM,mBAAmB,CAAC;AAE9F,OAAO,EAEL,wBAAwB,EACxB,cAAc,EACd,eAAe,EAChB,MAAM,kBAAkB,CAAC;;8BAuHQ,OAAO,CAAC;QAAE,uBAAuB,EAAE,OAAO,CAAA;KAAE,CAAC;wCAMlE,wBAAwB,GAChC,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;qCAMM,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoLocation.web.d.ts","sourceRoot":"","sources":["../src/ExpoLocation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAyC,MAAM,mBAAmB,CAAC;AAE9F,OAAO,EAEL,wBAAwB,EACxB,cAAc,EACd,eAAe,EAChB,MAAM,kBAAkB,CAAC;;8BAuHQ,OAAO,CAAC;QAAE,uBAAuB,EAAE,OAAO,CAAA;KAAE,CAAC;wCAMlE,wBAAwB,GAChC,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;qCAMM,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;8BAahD,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;mCAGjB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;+BAG1B,OAAO,CAAC,OAAO,CAAC;oBAG3B,OAAO,CAAC,GAAG,EAAE,CAAC;2BAGP,OAAO,CAAC,GAAG,EAAE,CAAC;oCAGL,MAAM,WAAW,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;yCAiB7C,OAAO,CAAC,kBAAkB,CAAC;yCAG3B,OAAO,CAAC,kBAAkB,CAAC;qCAG/B,OAAO,CAAC,kBAAkB,CAAC;qCAG3B,OAAO,CAAC,kBAAkB,CAAC;;AApEpE,wBAuEE"}
|
|
@@ -127,7 +127,7 @@ export default {
|
|
|
127
127
|
async removeWatchAsync(watchId) {
|
|
128
128
|
navigator.geolocation.clearWatch(watchId);
|
|
129
129
|
},
|
|
130
|
-
async watchDeviceHeading(
|
|
130
|
+
async watchDeviceHeading(_headingId) {
|
|
131
131
|
console.warn('Location.watchDeviceHeading: is not supported on web');
|
|
132
132
|
},
|
|
133
133
|
async hasServicesEnabledAsync() {
|
|
@@ -141,8 +141,7 @@ export default {
|
|
|
141
141
|
},
|
|
142
142
|
async watchPositionImplAsync(watchId, options) {
|
|
143
143
|
return new Promise((resolve) => {
|
|
144
|
-
|
|
145
|
-
watchId = global.navigator.geolocation.watchPosition((position) => {
|
|
144
|
+
watchId = navigator.geolocation.watchPosition((position) => {
|
|
146
145
|
lastKnownPosition = geolocationPositionToJSON(position);
|
|
147
146
|
LocationEventEmitter.emit('Expo.locationChanged', {
|
|
148
147
|
watchId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoLocation.web.js","sourceRoot":"","sources":["../src/ExpoLocation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE9F,OAAO,EACL,gBAAgB,GAIjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,aAAc,SAAQ,KAAK;IAC/B,IAAI,CAAS;IAEb;QACE,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,QAAwB;IACzD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC;IACvC,OAAO;QACL,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB;QACD,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,QAAwB,EAA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QAAQ,CAAC,CAAC;gBACxD,oBAAoB,CAAC,IAAI,CAAC,sBAAsB,EAAE;oBAChD,OAAO;oBACP,QAAQ,EAAE,iBAAiB;iBAC5B,CAAC,CAAC;YACL,CAAC,EACD,SAAS,EACT,OAAO,CACR,CAAC;YACF,OAAO,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,iCAAiC;QACrC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,KAAK,CAAC,iCAAiC;QACrC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,KAAK,CAAC,6BAA6B;QACjC,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IACD,KAAK,CAAC,6BAA6B;QACjC,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;CACF,CAAC","sourcesContent":["import { PermissionResponse, PermissionStatus, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n LocationAccuracy,\n LocationLastKnownOptions,\n LocationObject,\n LocationOptions,\n} from './Location.types';\nimport { LocationEventEmitter } from './LocationEventEmitter';\n\nclass GeocoderError extends Error {\n code: string;\n\n constructor() {\n super('Geocoder service is not available for this device.');\n this.code = 'E_NO_GEOCODER';\n }\n}\n\n/**\n * Converts `GeolocationPosition` to JavaScript object.\n */\nfunction geolocationPositionToJSON(position: LocationObject): LocationObject {\n const { coords, timestamp } = position;\n return {\n coords: {\n latitude: coords.latitude,\n longitude: coords.longitude,\n altitude: coords.altitude,\n accuracy: coords.accuracy,\n altitudeAccuracy: coords.altitudeAccuracy,\n heading: coords.heading,\n speed: coords.speed,\n },\n timestamp,\n };\n}\n\n/**\n * Checks whether given location didn't exceed given `maxAge` and fits in the required accuracy.\n */\nfunction isLocationValid(location: LocationObject, options: LocationLastKnownOptions): boolean {\n const maxAge = typeof options.maxAge === 'number' ? options.maxAge : Infinity;\n const requiredAccuracy =\n typeof options.requiredAccuracy === 'number' ? options.requiredAccuracy : Infinity;\n const locationAccuracy = location.coords.accuracy ?? Infinity;\n\n return Date.now() - location.timestamp <= maxAge && locationAccuracy <= requiredAccuracy;\n}\n\n/**\n * Gets the permission details. The implementation is not very good as it's not\n * possible to query for permission on all browsers, apparently only the\n * latest versions will support this.\n */\nasync function getPermissionsAsync(shouldAsk = false): Promise<PermissionResponse> {\n if (!navigator?.permissions?.query) {\n throw new UnavailabilityError('expo-location', 'navigator.permissions API is not available');\n }\n\n const permission = await navigator.permissions.query({ name: 'geolocation' });\n\n if (permission.state === 'granted') {\n return {\n status: PermissionStatus.GRANTED,\n granted: true,\n canAskAgain: true,\n expires: 0,\n };\n }\n\n if (permission.state === 'denied') {\n return {\n status: PermissionStatus.DENIED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n };\n }\n\n if (shouldAsk) {\n return new Promise((resolve) => {\n navigator.geolocation.getCurrentPosition(\n () => {\n resolve({\n status: PermissionStatus.GRANTED,\n granted: true,\n canAskAgain: true,\n expires: 0,\n });\n },\n (positionError: GeolocationPositionError) => {\n if (positionError.code === positionError.PERMISSION_DENIED) {\n resolve({\n status: PermissionStatus.DENIED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n });\n return;\n }\n\n resolve({\n status: PermissionStatus.GRANTED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n });\n }\n );\n });\n }\n\n // The permission state is 'prompt' when the permission has not been requested\n // yet, tested on Chrome.\n return {\n status: PermissionStatus.UNDETERMINED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n };\n}\n\nlet lastKnownPosition: LocationObject | null = null;\n\nexport default {\n async getProviderStatusAsync(): Promise<{ locationServicesEnabled: boolean }> {\n return {\n locationServicesEnabled: 'geolocation' in navigator,\n };\n },\n async getLastKnownPositionAsync(\n options: LocationLastKnownOptions = {}\n ): Promise<LocationObject | null> {\n if (lastKnownPosition && isLocationValid(lastKnownPosition, options)) {\n return lastKnownPosition;\n }\n return null;\n },\n async getCurrentPositionAsync(options: LocationOptions): Promise<LocationObject> {\n return new Promise<LocationObject>((resolve, reject) => {\n const resolver = (position) => {\n lastKnownPosition = geolocationPositionToJSON(position);\n resolve(lastKnownPosition);\n };\n navigator.geolocation.getCurrentPosition(resolver, reject, {\n maximumAge: Infinity,\n enableHighAccuracy: (options.accuracy ?? 0) > LocationAccuracy.Balanced,\n ...options,\n });\n });\n },\n async removeWatchAsync(watchId): Promise<void> {\n navigator.geolocation.clearWatch(watchId);\n },\n async watchDeviceHeading(headingId): Promise<void> {\n console.warn('Location.watchDeviceHeading: is not supported on web');\n },\n async hasServicesEnabledAsync(): Promise<boolean> {\n return 'geolocation' in navigator;\n },\n async geocodeAsync(): Promise<any[]> {\n throw new GeocoderError();\n },\n async reverseGeocodeAsync(): Promise<any[]> {\n throw new GeocoderError();\n },\n async watchPositionImplAsync(watchId: string, options: LocationOptions): Promise<string> {\n return new Promise<string>((resolve) => {\n // @ts-ignore: the types here need to be fixed\n watchId = global.navigator.geolocation.watchPosition(\n (position) => {\n lastKnownPosition = geolocationPositionToJSON(position);\n LocationEventEmitter.emit('Expo.locationChanged', {\n watchId,\n location: lastKnownPosition,\n });\n },\n undefined,\n options\n );\n resolve(watchId);\n });\n },\n\n async requestForegroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync(true);\n },\n async requestBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync(true);\n },\n async getForegroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync();\n },\n async getBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync();\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ExpoLocation.web.js","sourceRoot":"","sources":["../src/ExpoLocation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE9F,OAAO,EACL,gBAAgB,GAIjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAA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Status, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n LocationAccuracy,\n LocationLastKnownOptions,\n LocationObject,\n LocationOptions,\n} from './Location.types';\nimport { LocationEventEmitter } from './LocationEventEmitter';\n\nclass GeocoderError extends Error {\n code: string;\n\n constructor() {\n super('Geocoder service is not available for this device.');\n this.code = 'E_NO_GEOCODER';\n }\n}\n\n/**\n * Converts `GeolocationPosition` to JavaScript object.\n */\nfunction geolocationPositionToJSON(position: LocationObject): LocationObject {\n const { coords, timestamp } = position;\n return {\n coords: {\n latitude: coords.latitude,\n longitude: coords.longitude,\n altitude: coords.altitude,\n accuracy: coords.accuracy,\n altitudeAccuracy: coords.altitudeAccuracy,\n heading: coords.heading,\n speed: coords.speed,\n },\n timestamp,\n };\n}\n\n/**\n * Checks whether given location didn't exceed given `maxAge` and fits in the required accuracy.\n */\nfunction isLocationValid(location: LocationObject, options: LocationLastKnownOptions): boolean {\n const maxAge = typeof options.maxAge === 'number' ? options.maxAge : Infinity;\n const requiredAccuracy =\n typeof options.requiredAccuracy === 'number' ? options.requiredAccuracy : Infinity;\n const locationAccuracy = location.coords.accuracy ?? Infinity;\n\n return Date.now() - location.timestamp <= maxAge && locationAccuracy <= requiredAccuracy;\n}\n\n/**\n * Gets the permission details. The implementation is not very good as it's not\n * possible to query for permission on all browsers, apparently only the\n * latest versions will support this.\n */\nasync function getPermissionsAsync(shouldAsk = false): Promise<PermissionResponse> {\n if (!navigator?.permissions?.query) {\n throw new UnavailabilityError('expo-location', 'navigator.permissions API is not available');\n }\n\n const permission = await navigator.permissions.query({ name: 'geolocation' });\n\n if (permission.state === 'granted') {\n return {\n status: PermissionStatus.GRANTED,\n granted: true,\n canAskAgain: true,\n expires: 0,\n };\n }\n\n if (permission.state === 'denied') {\n return {\n status: PermissionStatus.DENIED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n };\n }\n\n if (shouldAsk) {\n return new Promise((resolve) => {\n navigator.geolocation.getCurrentPosition(\n () => {\n resolve({\n status: PermissionStatus.GRANTED,\n granted: true,\n canAskAgain: true,\n expires: 0,\n });\n },\n (positionError: GeolocationPositionError) => {\n if (positionError.code === positionError.PERMISSION_DENIED) {\n resolve({\n status: PermissionStatus.DENIED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n });\n return;\n }\n\n resolve({\n status: PermissionStatus.GRANTED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n });\n }\n );\n });\n }\n\n // The permission state is 'prompt' when the permission has not been requested\n // yet, tested on Chrome.\n return {\n status: PermissionStatus.UNDETERMINED,\n granted: false,\n canAskAgain: true,\n expires: 0,\n };\n}\n\nlet lastKnownPosition: LocationObject | null = null;\n\nexport default {\n async getProviderStatusAsync(): Promise<{ locationServicesEnabled: boolean }> {\n return {\n locationServicesEnabled: 'geolocation' in navigator,\n };\n },\n async getLastKnownPositionAsync(\n options: LocationLastKnownOptions = {}\n ): Promise<LocationObject | null> {\n if (lastKnownPosition && isLocationValid(lastKnownPosition, options)) {\n return lastKnownPosition;\n }\n return null;\n },\n async getCurrentPositionAsync(options: LocationOptions): Promise<LocationObject> {\n return new Promise<LocationObject>((resolve, reject) => {\n const resolver: PositionCallback = (position) => {\n lastKnownPosition = geolocationPositionToJSON(position);\n resolve(lastKnownPosition);\n };\n navigator.geolocation.getCurrentPosition(resolver, reject, {\n maximumAge: Infinity,\n enableHighAccuracy: (options.accuracy ?? 0) > LocationAccuracy.Balanced,\n ...options,\n });\n });\n },\n async removeWatchAsync(watchId: number): Promise<void> {\n navigator.geolocation.clearWatch(watchId);\n },\n async watchDeviceHeading(_headingId: number): Promise<void> {\n console.warn('Location.watchDeviceHeading: is not supported on web');\n },\n async hasServicesEnabledAsync(): Promise<boolean> {\n return 'geolocation' in navigator;\n },\n async geocodeAsync(): Promise<any[]> {\n throw new GeocoderError();\n },\n async reverseGeocodeAsync(): Promise<any[]> {\n throw new GeocoderError();\n },\n async watchPositionImplAsync(watchId: number, options: PositionOptions): Promise<number> {\n return new Promise((resolve) => {\n watchId = navigator.geolocation.watchPosition(\n (position) => {\n lastKnownPosition = geolocationPositionToJSON(position);\n LocationEventEmitter.emit('Expo.locationChanged', {\n watchId,\n location: lastKnownPosition,\n });\n },\n undefined,\n options\n );\n resolve(watchId);\n });\n },\n\n async requestForegroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync(true);\n },\n async requestBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync(true);\n },\n async getForegroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync();\n },\n async getBackgroundPermissionsAsync(): Promise<PermissionResponse> {\n return getPermissionsAsync();\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeolocationPolyfill.js","sourceRoot":"","sources":["../src/GeolocationPolyfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAkB,gBAAgB,EAAmB,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAW3D,cAAc;AACd;;GAEG;AACH,MAAM,UAAU,6BAA6B;IAC3C,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,+DAA+D;QAC/D,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;QAC/B,CAAC;QAED,aAAa;QACb,MAAM,CAAC,SAAS,CAAC,WAAW,GAAG;YAC7B,kBAAkB;YAClB,aAAa;YACb,UAAU;SACX,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,yBAAyB,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C,CAAC;IACX,CAAC;AACH,CAAC;AAED,gDAAgD;AAChD,SAAS,aAAa,CACpB,OAAmC,EACnC,KAA+B,EAC/B,OAA2B;IAE3B,MAAM,OAAO,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE7D,YAAY,CAAC,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAQ,EAAE,EAAE;QACvE,kBAAkB,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC/C,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,6CAA6C;AAC7C,SAAS,UAAU,CAAC,OAAe;IACjC,kBAAkB,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\n\nimport ExpoLocation from './ExpoLocation';\nimport { LocationObject, LocationAccuracy, LocationOptions } from './Location.types';\nimport { LocationSubscriber } from './LocationSubscribers';\n\ntype GeolocationSuccessCallback = (data: LocationObject) => void;\ntype GeolocationErrorCallback = (error: any) => void;\n\ntype GeolocationOptions = {\n enableHighAccuracy?: boolean;\n};\n\ndeclare const global: any;\n\n// @needsAudit\n/**\n * Polyfills `navigator.geolocation` for interop with the core React Native and Web API approach to geolocation.\n */\nexport function installWebGeolocationPolyfill(): void {\n if (Platform.OS !== 'web') {\n // Make sure `window.navigator` is defined in the global scope.\n if (!('window' in global)) {\n global.window = global;\n }\n if (!('navigator' in global.window)) {\n global.window.navigator = {};\n }\n\n // @ts-ignore\n window.navigator.geolocation = {\n getCurrentPosition,\n watchPosition,\n clearWatch,\n };\n }\n}\n\nfunction convertGeolocationOptions(options: GeolocationOptions): LocationOptions {\n return {\n accuracy: options.enableHighAccuracy ? LocationAccuracy.High : LocationAccuracy.Balanced,\n };\n}\n\nfunction getCurrentPosition(\n success: GeolocationSuccessCallback,\n error: GeolocationErrorCallback = () => {},\n options: GeolocationOptions = {}\n): void {\n _getCurrentPositionAsyncWrapper(success, error, options);\n}\n\n// This function exists to let us continue to return undefined from getCurrentPosition, while still\n// using async/await for the internal implementation of it\nasync function _getCurrentPositionAsyncWrapper(\n success: GeolocationSuccessCallback,\n error: GeolocationErrorCallback,\n options: GeolocationOptions\n): Promise<any> {\n try {\n await ExpoLocation.requestPermissionsAsync();\n const result = await ExpoLocation.getCurrentPositionAsync(convertGeolocationOptions(options));\n success(result);\n } catch (e) {\n error(e);\n }\n}\n\n// Polyfill: navigator.geolocation.watchPosition\nfunction watchPosition(\n success: GeolocationSuccessCallback,\n error: GeolocationErrorCallback,\n options: GeolocationOptions\n) {\n const watchId = LocationSubscriber.registerCallback(success);\n\n ExpoLocation.watchPositionImplAsync(watchId, options).catch((err: any) => {\n LocationSubscriber.unregisterCallback(watchId);\n error({ watchId, message: err.message, code: err.code });\n });\n\n return watchId;\n}\n\n// Polyfill: navigator.geolocation.clearWatch\nfunction clearWatch(watchId: number) {\n LocationSubscriber.unregisterCallback(watchId);\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e6b412bc03e477545551995ecd438279
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8d2597d046df91f4e4afff9c99314069d811a987
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d7e3900bfd3e7087a852c8ad3f56ed9151b6186e0d076c9464ab76b92eb509c4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
72450165ee1336765a3c50544b4f08be1685c324ea2fc37346e50f3d31d4226e6e994b94d1710473e86da6590376c9f1b09210af1e442a0ba89977174b90e12f
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.location",
|
|
6
|
-
"version": "18.1.
|
|
6
|
+
"version": "18.1.3",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
],
|
|
34
34
|
"files": [
|
|
35
35
|
{
|
|
36
|
-
"name": "expo.modules.location-18.1.
|
|
37
|
-
"url": "expo.modules.location-18.1.
|
|
38
|
-
"size":
|
|
39
|
-
"sha512": "
|
|
40
|
-
"sha256": "
|
|
41
|
-
"sha1": "
|
|
42
|
-
"md5": "
|
|
36
|
+
"name": "expo.modules.location-18.1.3.aar",
|
|
37
|
+
"url": "expo.modules.location-18.1.3.aar",
|
|
38
|
+
"size": 184743,
|
|
39
|
+
"sha512": "72450165ee1336765a3c50544b4f08be1685c324ea2fc37346e50f3d31d4226e6e994b94d1710473e86da6590376c9f1b09210af1e442a0ba89977174b90e12f",
|
|
40
|
+
"sha256": "d7e3900bfd3e7087a852c8ad3f56ed9151b6186e0d076c9464ab76b92eb509c4",
|
|
41
|
+
"sha1": "8d2597d046df91f4e4afff9c99314069d811a987",
|
|
42
|
+
"md5": "e6b412bc03e477545551995ecd438279"
|
|
43
43
|
}
|
|
44
44
|
]
|
|
45
45
|
},
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
],
|
|
77
77
|
"files": [
|
|
78
78
|
{
|
|
79
|
-
"name": "expo.modules.location-18.1.
|
|
80
|
-
"url": "expo.modules.location-18.1.
|
|
81
|
-
"size":
|
|
82
|
-
"sha512": "
|
|
83
|
-
"sha256": "
|
|
84
|
-
"sha1": "
|
|
85
|
-
"md5": "
|
|
79
|
+
"name": "expo.modules.location-18.1.3.aar",
|
|
80
|
+
"url": "expo.modules.location-18.1.3.aar",
|
|
81
|
+
"size": 184743,
|
|
82
|
+
"sha512": "72450165ee1336765a3c50544b4f08be1685c324ea2fc37346e50f3d31d4226e6e994b94d1710473e86da6590376c9f1b09210af1e442a0ba89977174b90e12f",
|
|
83
|
+
"sha256": "d7e3900bfd3e7087a852c8ad3f56ed9151b6186e0d076c9464ab76b92eb509c4",
|
|
84
|
+
"sha1": "8d2597d046df91f4e4afff9c99314069d811a987",
|
|
85
|
+
"md5": "e6b412bc03e477545551995ecd438279"
|
|
86
86
|
}
|
|
87
87
|
]
|
|
88
88
|
},
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
},
|
|
97
97
|
"files": [
|
|
98
98
|
{
|
|
99
|
-
"name": "expo.modules.location-18.1.
|
|
100
|
-
"url": "expo.modules.location-18.1.
|
|
99
|
+
"name": "expo.modules.location-18.1.3-sources.jar",
|
|
100
|
+
"url": "expo.modules.location-18.1.3-sources.jar",
|
|
101
101
|
"size": 22886,
|
|
102
102
|
"sha512": "68920c75933565fda76d75b67d44945458385ade303118b7942cf8e07ad741a25dafc44fa2a5046aaa04f6be46a13ef14d80ac131aedd115061b5ac7c863dc94",
|
|
103
103
|
"sha256": "d30c5c5e8e013d7356095a0ba9b19939ede75235295cac9193aa27a7601f2d8a",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
41a29640a8e869bc92765e492316266c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d686627b952b6996b5e35788d7cd1aaf7846f2de
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2a9d02d44245720288b60501b300ca06088c964aa0e4877a4d6ee9c2dbd36409
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7f0c8129ed7b6031994ab2c7c2213544661ad733130adef9ba628866c24473b528938b81a448169e3ccd9e8e226bfa6c581788a3519ffe9312996f7364b59e8b
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.location</artifactId>
|
|
12
|
-
<version>18.1.
|
|
12
|
+
<version>18.1.3</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.location</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
21a2b7ab17ef52e366f0e1e97fb5c413
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cd889649e4a8487702390ba2c7ede2a53f64107b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5a327b8ae71ac4de09977ec27e9ca372b60e0715cf4498eaebfb4fddf0082640
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cdbf84165d1e1412e357608ce2672ec5b37f8534005d1a7d5d8e4bf17e6724639496da8bbc7eb7e925c7f072dba073ea4ae0ea2658f354f99426457f0c0aca4a
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.location</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>18.1.
|
|
7
|
-
<release>18.1.
|
|
6
|
+
<latest>18.1.3</latest>
|
|
7
|
+
<release>18.1.3</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>18.1.
|
|
9
|
+
<version>18.1.3</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250425210749</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
717f35205227a652d16d1757f9e1edec
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3026d1f3d3dad9feb485ecaafe763ea69c0526f2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
b9f869a718d2d66f5d2cd25dd2b317212493e878748d56e1b7abe01c802b236f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c81fb2fe6ff5e2f31ae24122a0380e8ab06ec0dfe786e7c5663d83307738a6d46ede6e235aceeb1c76cfb0465549b16a86adb05f813912e3ab6d248235894471
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-location",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.3",
|
|
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,10 @@
|
|
|
39
39
|
"preset": "expo-module-scripts"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"expo-module-scripts": "^4.1.
|
|
42
|
+
"expo-module-scripts": "^4.1.5"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"expo": "*"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "3cd208465df78e385ca9380531bbbfe33ca68e81"
|
|
48
48
|
}
|
package/src/ExpoLocation.web.ts
CHANGED
|
@@ -139,7 +139,7 @@ export default {
|
|
|
139
139
|
},
|
|
140
140
|
async getCurrentPositionAsync(options: LocationOptions): Promise<LocationObject> {
|
|
141
141
|
return new Promise<LocationObject>((resolve, reject) => {
|
|
142
|
-
const resolver = (position) => {
|
|
142
|
+
const resolver: PositionCallback = (position) => {
|
|
143
143
|
lastKnownPosition = geolocationPositionToJSON(position);
|
|
144
144
|
resolve(lastKnownPosition);
|
|
145
145
|
};
|
|
@@ -150,10 +150,10 @@ export default {
|
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
152
|
},
|
|
153
|
-
async removeWatchAsync(watchId): Promise<void> {
|
|
153
|
+
async removeWatchAsync(watchId: number): Promise<void> {
|
|
154
154
|
navigator.geolocation.clearWatch(watchId);
|
|
155
155
|
},
|
|
156
|
-
async watchDeviceHeading(
|
|
156
|
+
async watchDeviceHeading(_headingId: number): Promise<void> {
|
|
157
157
|
console.warn('Location.watchDeviceHeading: is not supported on web');
|
|
158
158
|
},
|
|
159
159
|
async hasServicesEnabledAsync(): Promise<boolean> {
|
|
@@ -165,10 +165,9 @@ export default {
|
|
|
165
165
|
async reverseGeocodeAsync(): Promise<any[]> {
|
|
166
166
|
throw new GeocoderError();
|
|
167
167
|
},
|
|
168
|
-
async watchPositionImplAsync(watchId:
|
|
169
|
-
return new Promise
|
|
170
|
-
|
|
171
|
-
watchId = global.navigator.geolocation.watchPosition(
|
|
168
|
+
async watchPositionImplAsync(watchId: number, options: PositionOptions): Promise<number> {
|
|
169
|
+
return new Promise((resolve) => {
|
|
170
|
+
watchId = navigator.geolocation.watchPosition(
|
|
172
171
|
(position) => {
|
|
173
172
|
lastKnownPosition = geolocationPositionToJSON(position);
|
|
174
173
|
LocationEventEmitter.emit('Expo.locationChanged', {
|
|
@@ -74,7 +74,7 @@ function watchPosition(
|
|
|
74
74
|
) {
|
|
75
75
|
const watchId = LocationSubscriber.registerCallback(success);
|
|
76
76
|
|
|
77
|
-
ExpoLocation.watchPositionImplAsync(watchId, options).catch((err) => {
|
|
77
|
+
ExpoLocation.watchPositionImplAsync(watchId, options).catch((err: any) => {
|
|
78
78
|
LocationSubscriber.unregisterCallback(watchId);
|
|
79
79
|
error({ watchId, message: err.message, code: err.code });
|
|
80
80
|
});
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
556b18e4a484251868e2b80fb2400bc9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9eb1d7b49143fadcd5e69eccd214e25b23ca7e49
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1aea5a6b3fd289628062582aad3e511c3dded4b9e1698be4dabea6f8f8dee952
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9d46ba015b36cdb45893d41d39621afaae41598e4823ff3586f60417717930e93d3becddbbd502504546551cdb9a8424a1c595e63a7dc19479b79679de39c2b2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1673e22c081ba0e0f002d3f666e55fe8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
45fe0cf88da81590fa2115c905fcaf4607ae006c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d2951cd338da1df8ef7205c838c4beed863a37f1f24b60ef04f294987d6eee3f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f0d04f28452ce34c9abe67d27cfdbb0abbaf6aff282b7005da1c277364f2a608567da0a3ef85d44283e9c36c8ff22da25a5713db86f350870c115d0eece7f01a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
da2cb8b66a0dc51744c8123e5fb27ae3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8084da0b3558f7a3801d29e3ecbd21c1c7d48aa3
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
22b249684c438261478864e4a7bcfbe979780bcdd73d07d65488ca832a52f3d1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
811fa2b2eef137de960a1d1e53b42584d868975a6d7a82ed387d5d053602a49b650a3c1889136aebefde87668159540d49c70b001f86f656ee7718c2be5cfb47
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|