expo-location 14.1.0 → 14.2.2

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +2 -2
  3. package/android/build.gradle +41 -25
  4. package/android/src/main/java/expo/modules/location/LocationModule.java +1 -1
  5. package/android/src/main/java/expo/modules/location/services/LocationTaskService.java +7 -7
  6. package/android/src/main/java/expo/modules/location/taskConsumers/GeofencingTaskConsumer.java +5 -5
  7. package/android/src/main/java/expo/modules/location/taskConsumers/LocationTaskConsumer.java +6 -6
  8. package/build/Location.d.ts +2 -2
  9. package/build/Location.js +2 -2
  10. package/build/Location.js.map +1 -1
  11. package/build/Location.types.d.ts +11 -4
  12. package/build/Location.types.d.ts.map +1 -1
  13. package/build/Location.types.js.map +1 -1
  14. package/ios/EXLocation/EXLocation.m +3 -4
  15. package/ios/EXLocation/Requesters/EXBaseLocationRequester.m +7 -7
  16. package/ios/EXLocation/TaskConsumers/EXGeofencingTaskConsumer.h +3 -3
  17. package/ios/EXLocation/TaskConsumers/EXGeofencingTaskConsumer.m +4 -4
  18. package/ios/EXLocation/TaskConsumers/EXLocationTaskConsumer.h +3 -3
  19. package/ios/EXLocation/TaskConsumers/EXLocationTaskConsumer.m +3 -3
  20. package/ios/EXLocation.podspec +0 -1
  21. package/ios/EXLocation.xcframework/Info.plist +5 -5
  22. package/ios/EXLocation.xcframework/ios-arm64/EXLocation.framework/EXLocation +0 -0
  23. package/ios/EXLocation.xcframework/ios-arm64/EXLocation.framework/Info.plist +0 -0
  24. package/ios/EXLocation.xcframework/ios-arm64_x86_64-simulator/EXLocation.framework/EXLocation +0 -0
  25. package/ios/EXLocation.xcframework/ios-arm64_x86_64-simulator/EXLocation.framework/Info.plist +0 -0
  26. package/package.json +3 -4
  27. package/src/Location.ts +2 -2
  28. package/src/Location.types.ts +11 -4
package/CHANGELOG.md CHANGED
@@ -10,6 +10,27 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 14.2.2 — 2022-05-05
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fixed Android 12+ runtime crash caused by `PendingIntent` misconfiguration. ([#17333](https://github.com/expo/expo/pull/17333) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 14.2.1 — 2022-04-20
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
23
+ ## 14.2.0 — 2022-04-18
24
+
25
+ ### 🐛 Bug fixes
26
+
27
+ - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
28
+ - Fix LocationObject type ([#17070](https://github.com/expo/expo/pull/17070) by [@rakeshpetit](https://github.com/rakeshpetit))
29
+
30
+ ### ⚠️ Notices
31
+
32
+ - On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
33
+
13
34
  ## 14.1.0 — 2022-01-26
14
35
 
15
36
  ### 🐛 Bug fixes
@@ -23,6 +44,12 @@
23
44
  - Add an option to whether kill or keep the foreground service when app is killed on Android. ([#15633](https://github.com/expo/expo/pull/15633) by [@islamouzou](https://github.com/islamouzou))
24
45
  - Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
25
46
 
47
+ ## 14.0.2 — 2022-02-01
48
+
49
+ ### 🐛 Bug fixes
50
+
51
+ - Fix `Plugin with id 'maven' not found` build error from Android Gradle 7. ([#16080](https://github.com/expo/expo/pull/16080) by [@kudo](https://github.com/kudo))
52
+
26
53
  ## 14.0.1 — 2021-12-15
27
54
 
28
55
  _This version does not introduce any user-facing changes._
package/README.md CHANGED
@@ -5,11 +5,11 @@ Allows reading geolocation information from the device. Your app can poll for th
5
5
  # API documentation
6
6
 
7
7
  - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/location.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/location/)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/location/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/location/).
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/location/).
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
@@ -1,63 +1,80 @@
1
1
  apply plugin: 'com.android.library'
2
2
  apply plugin: 'kotlin-android'
3
- apply plugin: 'maven'
3
+ apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '14.1.0'
6
+ version = '14.2.2'
7
7
 
8
8
  buildscript {
9
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
10
+ if (expoModulesCorePlugin.exists()) {
11
+ apply from: expoModulesCorePlugin
12
+ applyKotlinExpoModulesCorePlugin()
13
+ }
14
+
9
15
  // Simple helper that allows the root project to override versions declared by this library.
10
16
  ext.safeExtGet = { prop, fallback ->
11
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12
18
  }
13
19
 
20
+ // Ensures backward compatibility
21
+ ext.getKotlinVersion = {
22
+ if (ext.has("kotlinVersion")) {
23
+ ext.kotlinVersion()
24
+ } else {
25
+ ext.safeExtGet("kotlinVersion", "1.6.10")
26
+ }
27
+ }
28
+
14
29
  repositories {
15
30
  mavenCentral()
16
31
  }
17
32
 
18
33
  dependencies {
19
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.6.10')}")
34
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
20
35
  }
21
36
  }
22
37
 
23
- // Upload android library to maven with javadoc and android sources
24
- configurations {
25
- deployerJars
26
- }
27
-
28
38
  // Creating sources with comments
29
39
  task androidSourcesJar(type: Jar) {
30
40
  classifier = 'sources'
31
41
  from android.sourceSets.main.java.srcDirs
32
42
  }
33
43
 
34
- // Put the androidSources and javadoc to the artifacts
35
- artifacts {
36
- archives androidSourcesJar
37
- }
38
-
39
- uploadArchives {
40
- repositories {
41
- mavenDeployer {
42
- configuration = configurations.deployerJars
43
- repository(url: mavenLocal().url)
44
+ afterEvaluate {
45
+ publishing {
46
+ publications {
47
+ release(MavenPublication) {
48
+ from components.release
49
+ // Add additional sourcesJar to artifacts
50
+ artifact(androidSourcesJar)
51
+ }
52
+ }
53
+ repositories {
54
+ maven {
55
+ url = mavenLocal().url
56
+ }
44
57
  }
45
58
  }
46
59
  }
47
60
 
48
61
  android {
49
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
62
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
50
63
 
51
64
  compileOptions {
52
- sourceCompatibility JavaVersion.VERSION_1_8
53
- targetCompatibility JavaVersion.VERSION_1_8
65
+ sourceCompatibility JavaVersion.VERSION_11
66
+ targetCompatibility JavaVersion.VERSION_11
67
+ }
68
+
69
+ kotlinOptions {
70
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
54
71
  }
55
72
 
56
73
  defaultConfig {
57
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
58
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
75
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
59
76
  versionCode 29
60
- versionName "14.1.0"
77
+ versionName "14.2.2"
61
78
  }
62
79
  lintOptions {
63
80
  abortOnError false
@@ -66,7 +83,6 @@ android {
66
83
 
67
84
  dependencies {
68
85
  implementation project(':expo-modules-core')
69
- implementation project(':unimodules-task-manager-interface')
70
86
 
71
87
  api 'com.google.android.gms:play-services-location:16.0.0'
72
88
 
@@ -74,5 +90,5 @@ dependencies {
74
90
  transitive = false
75
91
  }
76
92
 
77
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.6.10')}"
93
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
78
94
  }
@@ -50,13 +50,13 @@ import expo.modules.core.interfaces.ExpoMethod;
50
50
  import expo.modules.core.interfaces.LifecycleEventListener;
51
51
  import expo.modules.core.interfaces.services.EventEmitter;
52
52
  import expo.modules.core.interfaces.services.UIManager;
53
- import org.unimodules.interfaces.taskManager.TaskManagerInterface;
54
53
 
55
54
  import androidx.annotation.RequiresApi;
56
55
 
57
56
  import expo.modules.interfaces.permissions.Permissions;
58
57
  import expo.modules.interfaces.permissions.PermissionsResponse;
59
58
  import expo.modules.interfaces.permissions.PermissionsStatus;
59
+ import expo.modules.interfaces.taskManager.TaskManagerInterface;
60
60
  import expo.modules.location.exceptions.LocationBackgroundUnauthorizedException;
61
61
  import expo.modules.location.exceptions.LocationRequestRejectedException;
62
62
  import expo.modules.location.exceptions.LocationSettingsUnsatisfiedException;
@@ -10,8 +10,8 @@ import android.app.Service;
10
10
  import android.content.Context;
11
11
  import android.content.Intent;
12
12
  import android.graphics.Color;
13
- import android.net.Uri;
14
13
  import android.os.Binder;
14
+ import android.os.Build;
15
15
  import android.os.Bundle;
16
16
  import android.os.IBinder;
17
17
  import androidx.annotation.Nullable;
@@ -21,7 +21,7 @@ public class LocationTaskService extends Service {
21
21
  private static final String TAG = "LocationTaskService";
22
22
  private static int sServiceId = 481756;
23
23
  private String mChannelId;
24
- private String killService = "false";
24
+ private boolean mKillService = false;
25
25
  private Context mParentContext;
26
26
  private int mServiceId = sServiceId++;
27
27
  private final IBinder mBinder = new ServiceBinder();
@@ -46,6 +46,7 @@ public class LocationTaskService extends Service {
46
46
 
47
47
  if (extras != null) {
48
48
  mChannelId = extras.getString("appId") + ":" + extras.getString("taskName");
49
+ mKillService = extras.getBoolean("killService", false);
49
50
  }
50
51
 
51
52
  return START_REDELIVER_INTENT;
@@ -64,10 +65,7 @@ public class LocationTaskService extends Service {
64
65
 
65
66
  @Override
66
67
  public void onTaskRemoved(Intent rootIntent) {
67
- Bundle extras = rootIntent.getExtras();
68
- extras.getString("killService");
69
-
70
- if(killService == "true"){
68
+ if (mKillService){
71
69
  super.onTaskRemoved(rootIntent);
72
70
  stop();
73
71
  }
@@ -106,7 +104,9 @@ public class LocationTaskService extends Service {
106
104
 
107
105
  if (intent != null) {
108
106
  intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
109
- PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
107
+ // We're defaulting to the behaviour prior API 31 (mutable) even though Android recommends immutability
108
+ int mutableFlag = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? PendingIntent.FLAG_MUTABLE : 0;
109
+ PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | mutableFlag);
110
110
  builder.setContentIntent(contentIntent);
111
111
  }
112
112
 
@@ -23,13 +23,13 @@ import java.util.List;
23
23
  import java.util.Map;
24
24
  import java.util.UUID;
25
25
 
26
- import org.unimodules.interfaces.taskManager.TaskConsumer;
27
- import org.unimodules.interfaces.taskManager.TaskManagerUtilsInterface;
28
- import org.unimodules.interfaces.taskManager.TaskConsumerInterface;
29
- import org.unimodules.interfaces.taskManager.TaskExecutionCallback;
30
- import org.unimodules.interfaces.taskManager.TaskInterface;
31
26
  import expo.modules.location.LocationHelpers;
32
27
  import expo.modules.location.LocationModule;
28
+ import expo.modules.interfaces.taskManager.TaskConsumer;
29
+ import expo.modules.interfaces.taskManager.TaskConsumerInterface;
30
+ import expo.modules.interfaces.taskManager.TaskExecutionCallback;
31
+ import expo.modules.interfaces.taskManager.TaskInterface;
32
+ import expo.modules.interfaces.taskManager.TaskManagerUtilsInterface;
33
33
 
34
34
  public class GeofencingTaskConsumer extends TaskConsumer implements TaskConsumerInterface {
35
35
  public static int VERSION = 1;
@@ -26,11 +26,6 @@ import expo.modules.core.arguments.MapArguments;
26
26
  import expo.modules.core.arguments.ReadableArguments;
27
27
  import expo.modules.core.interfaces.Arguments;
28
28
  import expo.modules.core.interfaces.LifecycleEventListener;
29
- import org.unimodules.interfaces.taskManager.TaskConsumer;
30
- import org.unimodules.interfaces.taskManager.TaskConsumerInterface;
31
- import org.unimodules.interfaces.taskManager.TaskExecutionCallback;
32
- import org.unimodules.interfaces.taskManager.TaskInterface;
33
- import org.unimodules.interfaces.taskManager.TaskManagerUtilsInterface;
34
29
 
35
30
  import java.util.ArrayList;
36
31
  import java.util.Collections;
@@ -40,6 +35,11 @@ import java.util.Map;
40
35
  import androidx.annotation.NonNull;
41
36
  import expo.modules.location.LocationHelpers;
42
37
  import expo.modules.location.services.LocationTaskService;
38
+ import expo.modules.interfaces.taskManager.TaskConsumer;
39
+ import expo.modules.interfaces.taskManager.TaskConsumerInterface;
40
+ import expo.modules.interfaces.taskManager.TaskExecutionCallback;
41
+ import expo.modules.interfaces.taskManager.TaskInterface;
42
+ import expo.modules.interfaces.taskManager.TaskManagerUtilsInterface;
43
43
 
44
44
  public class LocationTaskConsumer extends TaskConsumer implements TaskConsumerInterface, LifecycleEventListener {
45
45
  private static final String TAG = "LocationTaskConsumer";
@@ -234,7 +234,7 @@ public class LocationTaskConsumer extends TaskConsumer implements TaskConsumerIn
234
234
  // extras param name is appId for legacy reasons
235
235
  extras.putString("appId", mTask.getAppScopeKey());
236
236
  extras.putString("taskName", mTask.getName());
237
- extras.putString("killService", serviceOptions.getString("killServiceOnDestroy"));
237
+ extras.putBoolean("killService", serviceOptions.getBoolean("killServiceOnDestroy", false));
238
238
 
239
239
  serviceIntent.putExtras(extras);
240
240
 
@@ -90,13 +90,13 @@ export declare function reverseGeocodeAsync(location: Pick<LocationGeocodedLocat
90
90
  /**
91
91
  * Checks user's permissions for accessing location.
92
92
  * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).
93
- * @deprecated __Deprecated.__ Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.
93
+ * @deprecated Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.
94
94
  */
95
95
  export declare function getPermissionsAsync(): Promise<LocationPermissionResponse>;
96
96
  /**
97
97
  * Asks the user to grant permissions for location.
98
98
  * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).
99
- * @deprecated __Deprecated.__ Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.
99
+ * @deprecated Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.
100
100
  */
101
101
  export declare function requestPermissionsAsync(): Promise<LocationPermissionResponse>;
102
102
  /**
package/build/Location.js CHANGED
@@ -160,7 +160,7 @@ export async function reverseGeocodeAsync(location, options) {
160
160
  /**
161
161
  * Checks user's permissions for accessing location.
162
162
  * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).
163
- * @deprecated __Deprecated.__ Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.
163
+ * @deprecated Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.
164
164
  */
165
165
  export async function getPermissionsAsync() {
166
166
  console.warn(`"getPermissionsAsync()" is now deprecated. Please use "getForegroundPermissionsAsync()" or "getBackgroundPermissionsAsync()" instead.`);
@@ -170,7 +170,7 @@ export async function getPermissionsAsync() {
170
170
  /**
171
171
  * Asks the user to grant permissions for location.
172
172
  * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).
173
- * @deprecated __Deprecated.__ Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.
173
+ * @deprecated Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.
174
174
  */
175
175
  export async function requestPermissionsAsync() {
176
176
  console.warn(`"requestPermissionsAsync()" is now deprecated. Please use "requestForegroundPermissionsAsync()" or "requestBackgroundPermissionsAsync()" instead.`);
@@ -1 +1 @@
1
- {"version":3,"file":"Location.js","sourceRoot":"","sources":["../src/Location.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGhB,oBAAoB,EACpB,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAE3B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAchB,oBAAoB,EACpB,2BAA2B,EAC3B,6BAA6B,GAE9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElG,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,OAAO,YAAY,CAAC,sBAAsB,EAAE,CAAC;AAC/C,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC9C,kFAAkF;IAClF,qGAAqG;IACrG,+GAA+G;IAC/G,wFAAwF;IAExF,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;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C,2BAA2B,IAAI,mBAAmB,EAClD,6BAA6B,IAAI,qBAAqB,EACtD,gBAAgB,EAEhB,eAAe,GAChB,CAAC;AAEF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,cAAc,kBAAkB,CAAC","sourcesContent":["import {\n PermissionStatus,\n PermissionResponse,\n PermissionHookOptions,\n createPermissionHook,\n Platform,\n} from 'expo-modules-core';\n\nimport ExpoLocation from './ExpoLocation';\nimport {\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 LocationActivityType,\n LocationGeofencingEventType,\n LocationGeofencingRegionState,\n LocationGeocodingOptions,\n} from './Location.types';\nimport { LocationEventEmitter } from './LocationEventEmitter';\nimport {\n setGoogleApiKey,\n googleGeocodeAsync,\n googleReverseGeocodeAsync,\n} from './LocationGoogleGeocoding';\nimport { LocationSubscriber, HeadingSubscriber, _getCurrentWatchId } from './LocationSubscribers';\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 */\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 [`Location.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 * [Location.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 * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n */\nexport async function watchPositionAsync(\n options: LocationOptions,\n callback: LocationCallback\n): Promise<LocationSubscription> {\n const watchId = LocationSubscriber.registerCallback(callback);\n await ExpoLocation.watchPositionImplAsync(watchId, options);\n\n return {\n remove() {\n LocationSubscriber.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) => {\n let tries = 0;\n\n const subscription = await watchHeadingAsync((heading) => {\n if (heading.accuracy > 1 || tries > 5) {\n subscription.remove();\n resolve(heading);\n } else {\n tries += 1;\n }\n });\n });\n}\n\n// @needsAudit\n/**\n * Subscribe to compass updates from the device.\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 * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n */\nexport async function watchHeadingAsync(\n callback: LocationHeadingCallback\n): Promise<LocationSubscription> {\n const watchId = HeadingSubscriber.registerCallback(callback);\n await ExpoLocation.watchDeviceHeading(watchId);\n\n return {\n remove() {\n HeadingSubscriber.unregisterCallback(watchId);\n },\n };\n}\n\n// @needsAudit\n/**\n * Geocode an address string to latitude-longitude location.\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 * > On Android, you must request a location permission (`Permissions.LOCATION`) from the user\n * > before geocoding can be used.\n * @param address A string representing address, eg. `\"Baker Street London\"`.\n * @param options\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedLocation`](#locationgeocodedlocation) objects.\n */\nexport async function geocodeAsync(\n address: string,\n options?: LocationGeocodingOptions\n): Promise<LocationGeocodedLocation[]> {\n if (typeof address !== 'string') {\n throw new TypeError(`Address to geocode must be a string. Got ${address} instead.`);\n }\n if (options?.useGoogleMaps || Platform.OS === 'web') {\n return await googleGeocodeAsync(address);\n }\n return await ExpoLocation.geocodeAsync(address);\n}\n\n// @needsAudit\n/**\n * Reverse geocode a location to postal address.\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 * > On Android, you must request a location permission (`Permissions.LOCATION`) from the user\n * > before geocoding can be used.\n * @param location An object representing a location.\n * @param options\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedAddress`](#locationgeocodedaddress) objects.\n */\nexport async function reverseGeocodeAsync(\n location: Pick<LocationGeocodedLocation, 'latitude' | 'longitude'>,\n options?: LocationGeocodingOptions\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 if (options?.useGoogleMaps || Platform.OS === 'web') {\n return await googleReverseGeocodeAsync(location);\n }\n return await ExpoLocation.reverseGeocodeAsync(location);\n}\n\n// @needsAudit\n/**\n * Checks user's permissions for accessing location.\n * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).\n * @deprecated __Deprecated.__ Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.\n */\nexport async function getPermissionsAsync(): Promise<LocationPermissionResponse> {\n console.warn(\n `\"getPermissionsAsync()\" is now deprecated. Please use \"getForegroundPermissionsAsync()\" or \"getBackgroundPermissionsAsync()\" instead.`\n );\n return await ExpoLocation.getPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to grant permissions for location.\n * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).\n * @deprecated __Deprecated.__ Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.\n */\nexport async function requestPermissionsAsync(): Promise<LocationPermissionResponse> {\n console.warn(\n `\"requestPermissionsAsync()\" is now deprecated. Please use \"requestForegroundPermissionsAsync()\" or \"requestBackgroundPermissionsAsync()\" instead.`\n );\n\n return await ExpoLocation.requestPermissionsAsync();\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 [PermissionResponse](#permissionresponse).\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 [PermissionResponse](#permissionresponse).\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 foreground 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 _validateTaskName(taskName: string) {\n if (!taskName || typeof taskName !== 'string') {\n throw new Error(`\\`taskName\\` must be a non-empty string. Got ${taskName} instead.`);\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 * @param taskName Name of the task receiving location updates.\n * @param options An object of options passed to the location manager.\n * @return A promise resolving once the task with location updates is registered.\n *\n * # Task parameters\n *\n * Background location task will be receiving following data:\n * - `locations` - An array of the new locations.\n *\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 */\nexport async function startLocationUpdatesAsync(\n taskName: string,\n options: LocationTaskOptions = { accuracy: LocationAccuracy.Balanced }\n): Promise<void> {\n _validateTaskName(taskName);\n await ExpoLocation.startLocationUpdatesAsync(taskName, options);\n}\n\n// @needsAudit\n/**\n * Stops geofencing 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 _validateTaskName(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 _validateTaskName(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 * @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 * @return A promise resolving as soon as the task is registered.\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 * # 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 _validateTaskName(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 _validateTaskName(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 _validateTaskName(taskName);\n return ExpoLocation.hasStartedGeofencingAsync(taskName);\n}\n\nexport { LocationEventEmitter as EventEmitter, _getCurrentWatchId };\n\nexport {\n LocationAccuracy as Accuracy,\n LocationActivityType as ActivityType,\n LocationGeofencingEventType as GeofencingEventType,\n LocationGeofencingRegionState as GeofencingRegionState,\n PermissionStatus,\n PermissionHookOptions,\n setGoogleApiKey,\n};\n\nexport { installWebGeolocationPolyfill } from './GeolocationPolyfill';\nexport * from './Location.types';\n"]}
1
+ {"version":3,"file":"Location.js","sourceRoot":"","sources":["../src/Location.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGhB,oBAAoB,EACpB,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAE3B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAchB,oBAAoB,EACpB,2BAA2B,EAC3B,6BAA6B,GAE9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElG,cAAc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,KAAK,UAAU,yBAAyB,CAAC,QAAgB;IAC9D,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEpE,OAAO,EACL,gBAAgB,IAAI,QAAQ,EAC5B,oBAAoB,IAAI,YAAY,EACpC,2BAA2B,IAAI,mBAAmB,EAClD,6BAA6B,IAAI,qBAAqB,EACtD,gBAAgB,EAEhB,eAAe,GAChB,CAAC;AAEF,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AACtE,cAAc,kBAAkB,CAAC","sourcesContent":["import {\n PermissionStatus,\n PermissionResponse,\n PermissionHookOptions,\n createPermissionHook,\n Platform,\n} from 'expo-modules-core';\n\nimport ExpoLocation from './ExpoLocation';\nimport {\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 LocationActivityType,\n LocationGeofencingEventType,\n LocationGeofencingRegionState,\n LocationGeocodingOptions,\n} from './Location.types';\nimport { LocationEventEmitter } from './LocationEventEmitter';\nimport {\n setGoogleApiKey,\n googleGeocodeAsync,\n googleReverseGeocodeAsync,\n} from './LocationGoogleGeocoding';\nimport { LocationSubscriber, HeadingSubscriber, _getCurrentWatchId } from './LocationSubscribers';\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 */\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 [`Location.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 * [Location.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 * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n */\nexport async function watchPositionAsync(\n options: LocationOptions,\n callback: LocationCallback\n): Promise<LocationSubscription> {\n const watchId = LocationSubscriber.registerCallback(callback);\n await ExpoLocation.watchPositionImplAsync(watchId, options);\n\n return {\n remove() {\n LocationSubscriber.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) => {\n let tries = 0;\n\n const subscription = await watchHeadingAsync((heading) => {\n if (heading.accuracy > 1 || tries > 5) {\n subscription.remove();\n resolve(heading);\n } else {\n tries += 1;\n }\n });\n });\n}\n\n// @needsAudit\n/**\n * Subscribe to compass updates from the device.\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 * @return A promise which fulfills with a [`LocationSubscription`](#locationsubscription) object.\n */\nexport async function watchHeadingAsync(\n callback: LocationHeadingCallback\n): Promise<LocationSubscription> {\n const watchId = HeadingSubscriber.registerCallback(callback);\n await ExpoLocation.watchDeviceHeading(watchId);\n\n return {\n remove() {\n HeadingSubscriber.unregisterCallback(watchId);\n },\n };\n}\n\n// @needsAudit\n/**\n * Geocode an address string to latitude-longitude location.\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 * > On Android, you must request a location permission (`Permissions.LOCATION`) from the user\n * > before geocoding can be used.\n * @param address A string representing address, eg. `\"Baker Street London\"`.\n * @param options\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedLocation`](#locationgeocodedlocation) objects.\n */\nexport async function geocodeAsync(\n address: string,\n options?: LocationGeocodingOptions\n): Promise<LocationGeocodedLocation[]> {\n if (typeof address !== 'string') {\n throw new TypeError(`Address to geocode must be a string. Got ${address} instead.`);\n }\n if (options?.useGoogleMaps || Platform.OS === 'web') {\n return await googleGeocodeAsync(address);\n }\n return await ExpoLocation.geocodeAsync(address);\n}\n\n// @needsAudit\n/**\n * Reverse geocode a location to postal address.\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 * > On Android, you must request a location permission (`Permissions.LOCATION`) from the user\n * > before geocoding can be used.\n * @param location An object representing a location.\n * @param options\n * @return A promise which fulfills with an array (in most cases its size is 1) of [`LocationGeocodedAddress`](#locationgeocodedaddress) objects.\n */\nexport async function reverseGeocodeAsync(\n location: Pick<LocationGeocodedLocation, 'latitude' | 'longitude'>,\n options?: LocationGeocodingOptions\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 if (options?.useGoogleMaps || Platform.OS === 'web') {\n return await googleReverseGeocodeAsync(location);\n }\n return await ExpoLocation.reverseGeocodeAsync(location);\n}\n\n// @needsAudit\n/**\n * Checks user's permissions for accessing location.\n * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).\n * @deprecated Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.\n */\nexport async function getPermissionsAsync(): Promise<LocationPermissionResponse> {\n console.warn(\n `\"getPermissionsAsync()\" is now deprecated. Please use \"getForegroundPermissionsAsync()\" or \"getBackgroundPermissionsAsync()\" instead.`\n );\n return await ExpoLocation.getPermissionsAsync();\n}\n\n// @needsAudit\n/**\n * Asks the user to grant permissions for location.\n * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).\n * @deprecated Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.\n */\nexport async function requestPermissionsAsync(): Promise<LocationPermissionResponse> {\n console.warn(\n `\"requestPermissionsAsync()\" is now deprecated. Please use \"requestForegroundPermissionsAsync()\" or \"requestBackgroundPermissionsAsync()\" instead.`\n );\n\n return await ExpoLocation.requestPermissionsAsync();\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 [PermissionResponse](#permissionresponse).\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 [PermissionResponse](#permissionresponse).\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 foreground 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 _validateTaskName(taskName: string) {\n if (!taskName || typeof taskName !== 'string') {\n throw new Error(`\\`taskName\\` must be a non-empty string. Got ${taskName} instead.`);\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 * @param taskName Name of the task receiving location updates.\n * @param options An object of options passed to the location manager.\n * @return A promise resolving once the task with location updates is registered.\n *\n * # Task parameters\n *\n * Background location task will be receiving following data:\n * - `locations` - An array of the new locations.\n *\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 */\nexport async function startLocationUpdatesAsync(\n taskName: string,\n options: LocationTaskOptions = { accuracy: LocationAccuracy.Balanced }\n): Promise<void> {\n _validateTaskName(taskName);\n await ExpoLocation.startLocationUpdatesAsync(taskName, options);\n}\n\n// @needsAudit\n/**\n * Stops geofencing 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 _validateTaskName(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 _validateTaskName(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 * @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 * @return A promise resolving as soon as the task is registered.\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 * # 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 _validateTaskName(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 _validateTaskName(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 _validateTaskName(taskName);\n return ExpoLocation.hasStartedGeofencingAsync(taskName);\n}\n\nexport { LocationEventEmitter as EventEmitter, _getCurrentWatchId };\n\nexport {\n LocationAccuracy as Accuracy,\n LocationActivityType as ActivityType,\n LocationGeofencingEventType as GeofencingEventType,\n LocationGeofencingRegionState as GeofencingRegionState,\n PermissionStatus,\n PermissionHookOptions,\n setGoogleApiKey,\n};\n\nexport { installWebGeolocationPolyfill } from './GeolocationPolyfill';\nexport * from './Location.types';\n"]}
@@ -99,14 +99,16 @@ export declare type LocationOptions = {
99
99
  */
100
100
  accuracy?: LocationAccuracy;
101
101
  /**
102
- * (Android only) Specifies whether to ask the user to turn on improved accuracy location mode
102
+ * Specifies whether to ask the user to turn on improved accuracy location mode
103
103
  * which uses Wi-Fi, cell networks and GPS sensor.
104
- * @default true.
104
+ * @default true
105
+ * @platform android
105
106
  */
106
107
  mayShowUserSettingsDialog?: boolean;
107
108
  /**
108
- * (Android only) Minimum time to wait between each update in milliseconds.
109
+ * Minimum time to wait between each update in milliseconds.
109
110
  * Default value may depend on `accuracy` option.
111
+ * @platform android
110
112
  */
111
113
  timeInterval?: number;
112
114
  /**
@@ -239,6 +241,11 @@ export declare type LocationObject = {
239
241
  * The time at which this position information was obtained, in milliseconds since epoch.
240
242
  */
241
243
  timestamp: number;
244
+ /**
245
+ * Whether the location coordinates is mocked or not.
246
+ * @platform android
247
+ */
248
+ mocked?: boolean;
242
249
  };
243
250
  /**
244
251
  * Type representing the location GPS related data.
@@ -431,7 +438,7 @@ export declare type PermissionDetailsLocationIOS = {
431
438
  };
432
439
  export declare type PermissionDetailsLocationAndroid = {
433
440
  /**
434
- * @deprecated __Deprecated.__ Use `accuracy` field instead.
441
+ * @deprecated Use `accuracy` field instead.
435
442
  */
436
443
  scope: 'fine' | 'coarse' | 'none';
437
444
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Location.types.d.ts","sourceRoot":"","sources":["../src/Location.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG/E;;GAEG;AACH,oBAAY,gBAAgB;IAC1B;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,GAAG,IAAI;IACP;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,IAAI,IAAI;IACR;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,iBAAiB,IAAI;CACtB;AAGD;;GAEG;AACH,oBAAY,oBAAoB;IAC9B;;OAEG;IACH,KAAK,IAAI;IACT;;;OAGG;IACH,oBAAoB,IAAI;IACxB;;;OAGG;IACH,OAAO,IAAI;IACX;;;OAGG;IACH,eAAe,IAAI;IACnB;;;;OAIG;IACH,QAAQ,IAAI;CACb;AAGD;;GAEG;AACH,oBAAY,2BAA2B;IACrC;;OAEG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,I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CAAA;IACX;;;OAGG;IACH,qFAAmB,CAAA;IACnB;;;;OAIG;IACH,uEAAY,CAAA;AACd,CAAC,EA1BW,oBAAoB,KAApB,oBAAoB,QA0B/B;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC;;OAEG;IACH,+EAAS,CAAA;IACT;;OAEG;IACH,6EAAQ,CAAA;AACV,CAAC,EATW,2BAA2B,KAA3B,2BAA2B,QAStC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,6BAaX;AAbD,WAAY,6BAA6B;IACvC;;OAEG;IACH,uFAAW,CAAA;IACX;;OAEG;IACH,qFAAU,CAAA;IACV;;OAEG;IACH,uFAAW,CAAA;AACb,CAAC,EAbW,6BAA6B,KAA7B,6BAA6B,QAaxC","sourcesContent":["import { PermissionResponse as UMPermissionResponse } from 'expo-modules-core';\n\n// @needsAudit\n/**\n * Enum with available location accuracies.\n */\nexport enum LocationAccuracy {\n /**\n * Accurate to the nearest three kilometers.\n */\n Lowest = 1,\n /**\n * Accurate to the nearest kilometer.\n */\n Low = 2,\n /**\n * Accurate to within one hundred meters.\n */\n Balanced = 3,\n /**\n * Accurate to within ten meters of the desired target.\n */\n High = 4,\n /**\n * The best level of accuracy available.\n */\n Highest = 5,\n /**\n * The highest possible accuracy that uses additional sensor data to facilitate navigation apps.\n */\n BestForNavigation = 6,\n}\n\n// @needsAudit\n/**\n * Enum with available activity types of background location tracking.\n */\nexport enum LocationActivityType {\n /**\n * Default activity type. Use it if there is no other type that matches the activity you track.\n */\n Other = 1,\n /**\n * Location updates are being used specifically during vehicular navigation to track location\n * changes to the automobile.\n */\n AutomotiveNavigation = 2,\n /**\n * Use this activity type if you track fitness activities such as walking, running, cycling,\n * and so on.\n */\n Fitness = 3,\n /**\n * Activity type for movements for other types of vehicular navigation that are not automobile\n * related.\n */\n OtherNavigation = 4,\n /**\n * Intended for airborne activities. Fall backs to `ActivityType.Other` if\n * unsupported.\n * @platform ios 12+\n */\n Airborne = 5,\n}\n\n// @needsAudit\n/**\n * A type of the event that geofencing task can receive.\n */\nexport enum LocationGeofencingEventType {\n /**\n * Emitted when the device entered observed region.\n */\n Enter = 1,\n /**\n * Occurs as soon as the device left observed region\n */\n Exit = 2,\n}\n\n// @needsAudit\n/**\n * State of the geofencing region that you receive through the geofencing task.\n */\nexport enum LocationGeofencingRegionState {\n /**\n * Indicates that the device position related to the region is unknown.\n */\n Unknown = 0,\n /**\n * Indicates that the device is inside the region.\n */\n Inside = 1,\n /**\n * Inverse of inside state.\n */\n Outside = 2,\n}\n\n// @needsAudit\n/**\n * Type representing options argument in `getCurrentPositionAsync`.\n */\nexport type LocationOptions = {\n /**\n * Location manager accuracy. Pass one of `LocationAccuracy` enum values.\n * For low-accuracies the implementation can avoid geolocation providers\n * that consume a significant amount of power (such as GPS).\n */\n accuracy?: LocationAccuracy;\n /**\n * (Android only) Specifies whether to ask the user to turn on improved accuracy location mode\n * which uses Wi-Fi, cell networks and GPS sensor.\n * @default true.\n */\n mayShowUserSettingsDialog?: boolean;\n /**\n * (Android only) Minimum time to wait between each update in milliseconds.\n * Default value may depend on `accuracy` option.\n */\n timeInterval?: number;\n /**\n * Receive updates only when the location has changed by at least this distance in meters.\n * Default value may depend on `accuracy` option.\n */\n distanceInterval?: number;\n};\n\n// @needsAudit\n/**\n * Type representing options object that can be passed to `getLastKnownPositionAsync`.\n */\nexport type LocationLastKnownOptions = {\n /**\n * A number of milliseconds after which the last known location starts to be invalid and thus\n * `null` is returned.\n */\n maxAge?: number;\n /**\n * The maximum radius of uncertainty for the location, measured in meters. If the last known\n * location's accuracy radius is bigger (less accurate) then `null` is returned.\n */\n requiredAccuracy?: number;\n};\n\n// @needsAudit\n/**\n * Type representing background location task options.\n */\nexport type LocationTaskOptions = LocationOptions & {\n /**\n * A boolean indicating whether the status bar changes its appearance when\n * location services are used in the background.\n * @default false\n * @platform ios 11+\n */\n showsBackgroundLocationIndicator?: boolean;\n /**\n * The distance in meters that must occur between last reported location and the current location\n * before deferred locations are reported.\n * @default 0\n */\n deferredUpdatesDistance?: number;\n // @docsMissing\n deferredUpdatesTimeout?: number;\n /**\n * Minimum time interval in milliseconds that must pass since last reported location before all\n * later locations are reported in a batched update\n * @default 0\n */\n deferredUpdatesInterval?: number;\n /**\n * The type of user activity associated with the location updates.\n * @see See [Apple docs](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620567-activitytype) for more details.\n * @default LocationActivityType.Other\n * @platform ios\n */\n activityType?: LocationActivityType;\n /**\n * A boolean value indicating whether the location manager can pause location\n * updates to improve battery life without sacrificing location data. When this option is set to\n * `true`, the location manager pauses updates (and powers down the appropriate hardware) at times\n * when the location data is unlikely to change. You can help the determination of when to pause\n * location updates by assigning a value to the `activityType` property.\n * @default false\n * @platform ios\n */\n pausesUpdatesAutomatically?: boolean;\n foregroundService?: LocationTaskServiceOptions;\n};\n\n// @needsAudit\nexport type LocationTaskServiceOptions = {\n /**\n * Title of the foreground service notification.\n */\n notificationTitle: string;\n /**\n * Subtitle of the foreground service notification.\n */\n notificationBody: string;\n /**\n * Color of the foreground service notification. Accepts `#RRGGBB` and `#AARRGGBB` hex formats.\n */\n notificationColor?: string;\n /**\n * Boolean value whether to destroy the foreground service if the app is killed.\n */\n killServiceOnDestroy?: boolean;\n};\n\n// @needsAudit\n/**\n * Type representing geofencing region object.\n */\nexport type LocationRegion = {\n /**\n * The identifier of the region object. Defaults to auto-generated UUID hash.\n */\n identifier?: string;\n /**\n * The latitude in degrees of region's center point.\n */\n latitude: number;\n /**\n * The longitude in degrees of region's center point.\n */\n longitude: number;\n /**\n * The radius measured in meters that defines the region's outer boundary.\n */\n radius: number;\n /**\n * Boolean value whether to call the task if the device enters the region.\n * @default true\n */\n notifyOnEnter?: boolean;\n /**\n * Boolean value whether to call the task if the device exits the region.\n * @default true\n */\n notifyOnExit?: boolean;\n /**\n * One of [GeofencingRegionState](#geofencingregionstate) region state. Determines whether the\n * device is inside or outside a region.\n */\n state?: LocationGeofencingRegionState;\n};\n\n// @needsAudit\n/**\n * Type representing the location object.\n */\nexport type LocationObject = {\n /**\n * The coordinates of the position.\n */\n coords: LocationObjectCoords;\n /**\n * The time at which this position information was obtained, in milliseconds since epoch.\n */\n timestamp: number;\n};\n\n// @needsAudit\n/**\n * Type representing the location GPS related data.\n */\nexport type LocationObjectCoords = {\n /**\n * The latitude in degrees.\n */\n latitude: number;\n /**\n * The longitude in degrees.\n */\n longitude: number;\n /**\n * The altitude in meters above the WGS 84 reference ellipsoid. Can be `null` on Web if it's not available.\n */\n altitude: number | null;\n /**\n * The radius of uncertainty for the location, measured in meters. Can be `null` on Web if it's not available.\n */\n accuracy: number | null;\n /**\n * The accuracy of the altitude value, in meters. Can be `null` on Web if it's not available.\n */\n altitudeAccuracy: number | null;\n /**\n * Horizontal direction of travel of this device, measured in degrees starting at due north and\n * continuing clockwise around the compass. Thus, north is 0 degrees, east is 90 degrees, south is\n * 180 degrees, and so on. Can be `null` on Web if it's not available.\n */\n heading: number | null;\n /**\n * The instantaneous speed of the device in meters per second. Can be `null` on Web if it's not available.\n */\n speed: number | null;\n};\n\n// @needsAudit\n/**\n * Represents `watchPositionAsync` callback.\n */\nexport type LocationCallback = (location: LocationObject) => any;\n\n// @needsAudit\n/**\n * Represents the object containing details about location provider.\n */\nexport type LocationProviderStatus = {\n /**\n * Whether location services are enabled. See [Location.hasServicesEnabledAsync](#locationhasservicesenabledasync)\n * for a more convenient solution to get this value.\n */\n locationServicesEnabled: boolean;\n // @docsMissing\n backgroundModeEnabled: boolean;\n /**\n * Whether the GPS provider is available. If `true` the location data will come\n * from GPS, especially for requests with high accuracy.\n * @platform android\n */\n gpsAvailable?: boolean;\n /**\n * Whether the network provider is available. If `true` the location data will\n * come from cellular network, especially for requests with low accuracy.\n * @platform android\n */\n networkAvailable?: boolean;\n /**\n * Whether the passive provider is available. If `true` the location data will\n * be determined passively.\n * @platform android\n */\n passiveAvailable?: boolean;\n};\n\n// @needsAudit\n/**\n * Type of the object containing heading details and provided by `watchHeadingAsync` callback.\n */\nexport type LocationHeadingObject = {\n /**\n * Measure of true north in degrees (needs location permissions, will return `-1` if not given).\n */\n trueHeading: number;\n /**\n * Measure of magnetic north in degrees.\n */\n magHeading: number;\n /**\n * Level of calibration of compass.\n * - `3`: high accuracy, `2`: medium accuracy, `1`: low accuracy, `0`: none\n * Reference for iOS:\n * - `3`: < 20 degrees uncertainty, `2`: < 35 degrees, `1`: < 50 degrees, `0`: > 50 degrees\n */\n accuracy: number;\n};\n\n// @needsAudit\n/**\n * Represents `watchHeadingAsync` callback.\n */\nexport type LocationHeadingCallback = (location: LocationHeadingObject) => any;\n\n// @needsAudit\n/**\n * An object of options for forward and reverse geocoding.\n */\nexport type LocationGeocodingOptions = {\n /**\n * Whether to force using Google Maps API instead of the native implementation.\n * Used by default only on Web platform. Requires providing an API key by `setGoogleApiKey`.\n */\n useGoogleMaps?: boolean;\n};\n\n// @needsAudit\n/**\n * Type representing a result of `geocodeAsync`.\n */\nexport type LocationGeocodedLocation = {\n /**\n * The latitude in degrees.\n */\n latitude: number;\n /**\n * The longitude in degrees.\n */\n longitude: number;\n /**\n * The altitude in meters above the WGS 84 reference ellipsoid.\n */\n altitude?: number;\n /**\n * The radius of uncertainty for the location, measured in meters.\n */\n accuracy?: number;\n};\n\n// @needsAudit\n/**\n * Type representing a result of `reverseGeocodeAsync`.\n */\nexport type LocationGeocodedAddress = {\n /**\n * City name of the address.\n */\n city: string | null;\n /**\n * Additional city-level information like district name.\n */\n district: string | null;\n /**\n * Street number of the address.\n */\n streetNumber: string | null;\n /**\n * Street name of the address.\n */\n street: string | null;\n /**\n * The state or province associated with the address.\n */\n region: string | null;\n /**\n * Additional information about administrative area.\n */\n subregion: string | null;\n /**\n * Localized country name of the address.\n */\n country: string | null;\n /**\n * Postal code of the address.\n */\n postalCode: string | null;\n /**\n * The name of the placemark, for example, \"Tower Bridge\".\n */\n name: string | null;\n /**\n * Localized (ISO) country code of the address, if available.\n */\n isoCountryCode: string | null;\n /**\n * The timezone identifier associated with the address.\n * @platform ios\n */\n timezone: string | null;\n};\n\n// @needsAudit\n/**\n * Represents subscription object returned by methods watching for new locations or headings.\n */\nexport type LocationSubscription = {\n /**\n * Call this function with no arguments to remove this subscription. The callback will no longer\n * be called for location updates.\n */\n remove: () => void;\n};\n\n// @needsAudit\nexport type PermissionDetailsLocationIOS = {\n /**\n * The scope of granted permission. Indicates when it's possible to use location.\n */\n scope: 'whenInUse' | 'always' | 'none';\n};\n\n// @needsAudit\nexport type PermissionDetailsLocationAndroid = {\n /**\n * @deprecated __Deprecated.__ Use `accuracy` field instead.\n */\n scope: 'fine' | 'coarse' | 'none';\n /**\n * Indicates the type of location provider.\n */\n accuracy: 'fine' | 'coarse' | 'none';\n};\n\n// @needsAudit\n/**\n * `LocationPermissionResponse` extends [PermissionResponse](permissions.md#permissionresponse)\n * type exported by `expo-modules-core` and contains additional platform-specific fields.\n */\nexport interface LocationPermissionResponse extends UMPermissionResponse {\n ios?: PermissionDetailsLocationIOS;\n android?: PermissionDetailsLocationAndroid;\n}\n"]}
1
+ {"version":3,"file":"Location.types.js","sourceRoot":"","sources":["../src/Location.types.ts"],"names":[],"mappings":"AAEA,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,gBAyBX;AAzBD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,2DAAU,CAAA;IACV;;OAEG;IACH,qDAAO,CAAA;IACP;;OAEG;IACH,+DAAY,CAAA;IACZ;;OAEG;IACH,uDAAQ,CAAA;IACR;;OAEG;IACH,6DAAW,CAAA;IACX;;OAEG;IACH,iFAAqB,CAAA;AACvB,CAAC,EAzBW,gBAAgB,KAAhB,gBAAgB,QAyB3B;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,oBA0BX;AA1BD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,iEAAS,CAAA;IACT;;;OAGG;IACH,+FAAwB,CAAA;IACxB;;;OAGG;IACH,qEAAW,CAAA;IACX;;;OAGG;IACH,qFAAmB,CAAA;IACnB;;;;OAIG;IACH,uEAAY,CAAA;AACd,CAAC,EA1BW,oBAAoB,KAApB,oBAAoB,QA0B/B;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC;;OAEG;IACH,+EAAS,CAAA;IACT;;OAEG;IACH,6EAAQ,CAAA;AACV,CAAC,EATW,2BAA2B,KAA3B,2BAA2B,QAStC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,CAAN,IAAY,6BAaX;AAbD,WAAY,6BAA6B;IACvC;;OAEG;IACH,uFAAW,CAAA;IACX;;OAEG;IACH,qFAAU,CAAA;IACV;;OAEG;IACH,uFAAW,CAAA;AACb,CAAC,EAbW,6BAA6B,KAA7B,6BAA6B,QAaxC","sourcesContent":["import { PermissionResponse as UMPermissionResponse } from 'expo-modules-core';\n\n// @needsAudit\n/**\n * Enum with available location accuracies.\n */\nexport enum LocationAccuracy {\n /**\n * Accurate to the nearest three kilometers.\n */\n Lowest = 1,\n /**\n * Accurate to the nearest kilometer.\n */\n Low = 2,\n /**\n * Accurate to within one hundred meters.\n */\n Balanced = 3,\n /**\n * Accurate to within ten meters of the desired target.\n */\n High = 4,\n /**\n * The best level of accuracy available.\n */\n Highest = 5,\n /**\n * The highest possible accuracy that uses additional sensor data to facilitate navigation apps.\n */\n BestForNavigation = 6,\n}\n\n// @needsAudit\n/**\n * Enum with available activity types of background location tracking.\n */\nexport enum LocationActivityType {\n /**\n * Default activity type. Use it if there is no other type that matches the activity you track.\n */\n Other = 1,\n /**\n * Location updates are being used specifically during vehicular navigation to track location\n * changes to the automobile.\n */\n AutomotiveNavigation = 2,\n /**\n * Use this activity type if you track fitness activities such as walking, running, cycling,\n * and so on.\n */\n Fitness = 3,\n /**\n * Activity type for movements for other types of vehicular navigation that are not automobile\n * related.\n */\n OtherNavigation = 4,\n /**\n * Intended for airborne activities. Fall backs to `ActivityType.Other` if\n * unsupported.\n * @platform ios 12+\n */\n Airborne = 5,\n}\n\n// @needsAudit\n/**\n * A type of the event that geofencing task can receive.\n */\nexport enum LocationGeofencingEventType {\n /**\n * Emitted when the device entered observed region.\n */\n Enter = 1,\n /**\n * Occurs as soon as the device left observed region\n */\n Exit = 2,\n}\n\n// @needsAudit\n/**\n * State of the geofencing region that you receive through the geofencing task.\n */\nexport enum LocationGeofencingRegionState {\n /**\n * Indicates that the device position related to the region is unknown.\n */\n Unknown = 0,\n /**\n * Indicates that the device is inside the region.\n */\n Inside = 1,\n /**\n * Inverse of inside state.\n */\n Outside = 2,\n}\n\n// @needsAudit\n/**\n * Type representing options argument in `getCurrentPositionAsync`.\n */\nexport type LocationOptions = {\n /**\n * Location manager accuracy. Pass one of `LocationAccuracy` enum values.\n * For low-accuracies the implementation can avoid geolocation providers\n * that consume a significant amount of power (such as GPS).\n */\n accuracy?: LocationAccuracy;\n /**\n * Specifies whether to ask the user to turn on improved accuracy location mode\n * which uses Wi-Fi, cell networks and GPS sensor.\n * @default true\n * @platform android\n */\n mayShowUserSettingsDialog?: boolean;\n /**\n * Minimum time to wait between each update in milliseconds.\n * Default value may depend on `accuracy` option.\n * @platform android\n */\n timeInterval?: number;\n /**\n * Receive updates only when the location has changed by at least this distance in meters.\n * Default value may depend on `accuracy` option.\n */\n distanceInterval?: number;\n};\n\n// @needsAudit\n/**\n * Type representing options object that can be passed to `getLastKnownPositionAsync`.\n */\nexport type LocationLastKnownOptions = {\n /**\n * A number of milliseconds after which the last known location starts to be invalid and thus\n * `null` is returned.\n */\n maxAge?: number;\n /**\n * The maximum radius of uncertainty for the location, measured in meters. If the last known\n * location's accuracy radius is bigger (less accurate) then `null` is returned.\n */\n requiredAccuracy?: number;\n};\n\n// @needsAudit\n/**\n * Type representing background location task options.\n */\nexport type LocationTaskOptions = LocationOptions & {\n /**\n * A boolean indicating whether the status bar changes its appearance when\n * location services are used in the background.\n * @default false\n * @platform ios 11+\n */\n showsBackgroundLocationIndicator?: boolean;\n /**\n * The distance in meters that must occur between last reported location and the current location\n * before deferred locations are reported.\n * @default 0\n */\n deferredUpdatesDistance?: number;\n // @docsMissing\n deferredUpdatesTimeout?: number;\n /**\n * Minimum time interval in milliseconds that must pass since last reported location before all\n * later locations are reported in a batched update\n * @default 0\n */\n deferredUpdatesInterval?: number;\n /**\n * The type of user activity associated with the location updates.\n * @see See [Apple docs](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620567-activitytype) for more details.\n * @default LocationActivityType.Other\n * @platform ios\n */\n activityType?: LocationActivityType;\n /**\n * A boolean value indicating whether the location manager can pause location\n * updates to improve battery life without sacrificing location data. When this option is set to\n * `true`, the location manager pauses updates (and powers down the appropriate hardware) at times\n * when the location data is unlikely to change. You can help the determination of when to pause\n * location updates by assigning a value to the `activityType` property.\n * @default false\n * @platform ios\n */\n pausesUpdatesAutomatically?: boolean;\n foregroundService?: LocationTaskServiceOptions;\n};\n\n// @needsAudit\nexport type LocationTaskServiceOptions = {\n /**\n * Title of the foreground service notification.\n */\n notificationTitle: string;\n /**\n * Subtitle of the foreground service notification.\n */\n notificationBody: string;\n /**\n * Color of the foreground service notification. Accepts `#RRGGBB` and `#AARRGGBB` hex formats.\n */\n notificationColor?: string;\n /**\n * Boolean value whether to destroy the foreground service if the app is killed.\n */\n killServiceOnDestroy?: boolean;\n};\n\n// @needsAudit\n/**\n * Type representing geofencing region object.\n */\nexport type LocationRegion = {\n /**\n * The identifier of the region object. Defaults to auto-generated UUID hash.\n */\n identifier?: string;\n /**\n * The latitude in degrees of region's center point.\n */\n latitude: number;\n /**\n * The longitude in degrees of region's center point.\n */\n longitude: number;\n /**\n * The radius measured in meters that defines the region's outer boundary.\n */\n radius: number;\n /**\n * Boolean value whether to call the task if the device enters the region.\n * @default true\n */\n notifyOnEnter?: boolean;\n /**\n * Boolean value whether to call the task if the device exits the region.\n * @default true\n */\n notifyOnExit?: boolean;\n /**\n * One of [GeofencingRegionState](#geofencingregionstate) region state. Determines whether the\n * device is inside or outside a region.\n */\n state?: LocationGeofencingRegionState;\n};\n\n// @needsAudit\n/**\n * Type representing the location object.\n */\nexport type LocationObject = {\n /**\n * The coordinates of the position.\n */\n coords: LocationObjectCoords;\n /**\n * The time at which this position information was obtained, in milliseconds since epoch.\n */\n timestamp: number;\n /**\n * Whether the location coordinates is mocked or not.\n * @platform android\n */\n mocked?: boolean;\n};\n\n// @needsAudit\n/**\n * Type representing the location GPS related data.\n */\nexport type LocationObjectCoords = {\n /**\n * The latitude in degrees.\n */\n latitude: number;\n /**\n * The longitude in degrees.\n */\n longitude: number;\n /**\n * The altitude in meters above the WGS 84 reference ellipsoid. Can be `null` on Web if it's not available.\n */\n altitude: number | null;\n /**\n * The radius of uncertainty for the location, measured in meters. Can be `null` on Web if it's not available.\n */\n accuracy: number | null;\n /**\n * The accuracy of the altitude value, in meters. Can be `null` on Web if it's not available.\n */\n altitudeAccuracy: number | null;\n /**\n * Horizontal direction of travel of this device, measured in degrees starting at due north and\n * continuing clockwise around the compass. Thus, north is 0 degrees, east is 90 degrees, south is\n * 180 degrees, and so on. Can be `null` on Web if it's not available.\n */\n heading: number | null;\n /**\n * The instantaneous speed of the device in meters per second. Can be `null` on Web if it's not available.\n */\n speed: number | null;\n};\n\n// @needsAudit\n/**\n * Represents `watchPositionAsync` callback.\n */\nexport type LocationCallback = (location: LocationObject) => any;\n\n// @needsAudit\n/**\n * Represents the object containing details about location provider.\n */\nexport type LocationProviderStatus = {\n /**\n * Whether location services are enabled. See [Location.hasServicesEnabledAsync](#locationhasservicesenabledasync)\n * for a more convenient solution to get this value.\n */\n locationServicesEnabled: boolean;\n // @docsMissing\n backgroundModeEnabled: boolean;\n /**\n * Whether the GPS provider is available. If `true` the location data will come\n * from GPS, especially for requests with high accuracy.\n * @platform android\n */\n gpsAvailable?: boolean;\n /**\n * Whether the network provider is available. If `true` the location data will\n * come from cellular network, especially for requests with low accuracy.\n * @platform android\n */\n networkAvailable?: boolean;\n /**\n * Whether the passive provider is available. If `true` the location data will\n * be determined passively.\n * @platform android\n */\n passiveAvailable?: boolean;\n};\n\n// @needsAudit\n/**\n * Type of the object containing heading details and provided by `watchHeadingAsync` callback.\n */\nexport type LocationHeadingObject = {\n /**\n * Measure of true north in degrees (needs location permissions, will return `-1` if not given).\n */\n trueHeading: number;\n /**\n * Measure of magnetic north in degrees.\n */\n magHeading: number;\n /**\n * Level of calibration of compass.\n * - `3`: high accuracy, `2`: medium accuracy, `1`: low accuracy, `0`: none\n * Reference for iOS:\n * - `3`: < 20 degrees uncertainty, `2`: < 35 degrees, `1`: < 50 degrees, `0`: > 50 degrees\n */\n accuracy: number;\n};\n\n// @needsAudit\n/**\n * Represents `watchHeadingAsync` callback.\n */\nexport type LocationHeadingCallback = (location: LocationHeadingObject) => any;\n\n// @needsAudit\n/**\n * An object of options for forward and reverse geocoding.\n */\nexport type LocationGeocodingOptions = {\n /**\n * Whether to force using Google Maps API instead of the native implementation.\n * Used by default only on Web platform. Requires providing an API key by `setGoogleApiKey`.\n */\n useGoogleMaps?: boolean;\n};\n\n// @needsAudit\n/**\n * Type representing a result of `geocodeAsync`.\n */\nexport type LocationGeocodedLocation = {\n /**\n * The latitude in degrees.\n */\n latitude: number;\n /**\n * The longitude in degrees.\n */\n longitude: number;\n /**\n * The altitude in meters above the WGS 84 reference ellipsoid.\n */\n altitude?: number;\n /**\n * The radius of uncertainty for the location, measured in meters.\n */\n accuracy?: number;\n};\n\n// @needsAudit\n/**\n * Type representing a result of `reverseGeocodeAsync`.\n */\nexport type LocationGeocodedAddress = {\n /**\n * City name of the address.\n */\n city: string | null;\n /**\n * Additional city-level information like district name.\n */\n district: string | null;\n /**\n * Street number of the address.\n */\n streetNumber: string | null;\n /**\n * Street name of the address.\n */\n street: string | null;\n /**\n * The state or province associated with the address.\n */\n region: string | null;\n /**\n * Additional information about administrative area.\n */\n subregion: string | null;\n /**\n * Localized country name of the address.\n */\n country: string | null;\n /**\n * Postal code of the address.\n */\n postalCode: string | null;\n /**\n * The name of the placemark, for example, \"Tower Bridge\".\n */\n name: string | null;\n /**\n * Localized (ISO) country code of the address, if available.\n */\n isoCountryCode: string | null;\n /**\n * The timezone identifier associated with the address.\n * @platform ios\n */\n timezone: string | null;\n};\n\n// @needsAudit\n/**\n * Represents subscription object returned by methods watching for new locations or headings.\n */\nexport type LocationSubscription = {\n /**\n * Call this function with no arguments to remove this subscription. The callback will no longer\n * be called for location updates.\n */\n remove: () => void;\n};\n\n// @needsAudit\nexport type PermissionDetailsLocationIOS = {\n /**\n * The scope of granted permission. Indicates when it's possible to use location.\n */\n scope: 'whenInUse' | 'always' | 'none';\n};\n\n// @needsAudit\nexport type PermissionDetailsLocationAndroid = {\n /**\n * @deprecated Use `accuracy` field instead.\n */\n scope: 'fine' | 'coarse' | 'none';\n /**\n * Indicates the type of location provider.\n */\n accuracy: 'fine' | 'coarse' | 'none';\n};\n\n// @needsAudit\n/**\n * `LocationPermissionResponse` extends [PermissionResponse](permissions.md#permissionresponse)\n * type exported by `expo-modules-core` and contains additional platform-specific fields.\n */\nexport interface LocationPermissionResponse extends UMPermissionResponse {\n ios?: PermissionDetailsLocationIOS;\n android?: PermissionDetailsLocationAndroid;\n}\n"]}
@@ -20,8 +20,7 @@
20
20
 
21
21
  #import <ExpoModulesCore/EXPermissionsInterface.h>
22
22
  #import <ExpoModulesCore/EXPermissionsMethodsDelegate.h>
23
-
24
- #import <UMTaskManagerInterface/UMTaskManagerInterface.h>
23
+ #import <ExpoModulesCore/EXTaskManagerInterface.h>
25
24
 
26
25
  NS_ASSUME_NONNULL_BEGIN
27
26
 
@@ -34,7 +33,7 @@ NSString * const EXHeadingChangedEventName = @"Expo.headingChanged";
34
33
  @property (nonatomic, strong) NSMutableSet<EXLocationDelegate *> *retainedDelegates;
35
34
  @property (nonatomic, weak) id<EXEventEmitterService> eventEmitter;
36
35
  @property (nonatomic, weak) id<EXPermissionsInterface> permissionsManager;
37
- @property (nonatomic, weak) id<UMTaskManagerInterface> tasksManager;
36
+ @property (nonatomic, weak) id<EXTaskManagerInterface> tasksManager;
38
37
 
39
38
  @end
40
39
 
@@ -54,7 +53,7 @@ EX_EXPORT_MODULE(ExpoLocation);
54
53
  - (void)setModuleRegistry:(EXModuleRegistry *)moduleRegistry
55
54
  {
56
55
  _eventEmitter = [moduleRegistry getModuleImplementingProtocol:@protocol(EXEventEmitterService)];
57
- _tasksManager = [moduleRegistry getModuleImplementingProtocol:@protocol(UMTaskManagerInterface)];
56
+ _tasksManager = [moduleRegistry getModuleImplementingProtocol:@protocol(EXTaskManagerInterface)];
58
57
 
59
58
  _permissionsManager = [moduleRegistry getModuleImplementingProtocol:@protocol(EXPermissionsInterface)];
60
59
  [EXPermissionsMethodsDelegate registerRequesters:@[
@@ -34,15 +34,15 @@
34
34
  # pragma mark - UMPermissionsRequester
35
35
 
36
36
  - (NSDictionary *)getPermissions {
37
-
37
+
38
38
  CLAuthorizationStatus systemStatus;
39
39
  if (![EXBaseLocationRequester isConfiguredForAlwaysAuthorization] && ![EXBaseLocationRequester isConfiguredForWhenInUseAuthorization]) {
40
- EXFatal(EXErrorWithMessage(@"This app is missing usage descriptions, so location services will fail. Add one of the `NSLocation*UsageDescription` keys to your bundle's Info.plist. See https://bit.ly/2P5fEbG (https://docs.expo.io/versions/latest/guides/app-stores.html#system-permissions-dialogs-on-ios) for more information."));
40
+ EXFatal(EXErrorWithMessage(@"This app is missing usage descriptions, so location services will fail. Add one of the `NSLocation*UsageDescription` keys to your bundle's Info.plist. See https://bit.ly/3iLqy6S (https://docs.expo.dev/distribution/app-stores/#system-permissions-dialogs-on-ios) for more information."));
41
41
  systemStatus = kCLAuthorizationStatusDenied;
42
42
  } else {
43
43
  systemStatus = [CLLocationManager authorizationStatus];
44
44
  }
45
-
45
+
46
46
  return [self parsePermissions:systemStatus];
47
47
  }
48
48
 
@@ -120,7 +120,7 @@
120
120
  _locationManagerWasCalled = true;
121
121
  return;
122
122
  }
123
-
123
+
124
124
  if (_resolve) {
125
125
  _resolve([self getPermissions]);
126
126
  _resolve = nil;
@@ -139,7 +139,7 @@
139
139
  _locationManagerWasCalled = true;
140
140
  return;
141
141
  }
142
-
142
+
143
143
  if (_resolve) {
144
144
  _resolve([self getPermissions]);
145
145
  _resolve = nil;
@@ -149,7 +149,7 @@
149
149
  }
150
150
 
151
151
  #pragma mark - Helpers
152
-
152
+
153
153
  + (BOOL)isConfiguredForWhenInUseAuthorization
154
154
  {
155
155
  return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"] != nil;
@@ -160,5 +160,5 @@
160
160
  return [self isConfiguredForWhenInUseAuthorization] && [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysAndWhenInUseUsageDescription"];
161
161
  }
162
162
 
163
-
163
+
164
164
  @end
@@ -1,13 +1,13 @@
1
1
  // Copyright 2018-present 650 Industries. All rights reserved.
2
2
 
3
3
  #import <CoreLocation/CLLocationManagerDelegate.h>
4
- #import <UMTaskManagerInterface/UMTaskConsumerInterface.h>
4
+ #import <ExpoModulesCore/EXTaskConsumerInterface.h>
5
5
 
6
6
  NS_ASSUME_NONNULL_BEGIN
7
7
 
8
- @interface EXGeofencingTaskConsumer : NSObject <UMTaskConsumerInterface, CLLocationManagerDelegate>
8
+ @interface EXGeofencingTaskConsumer : NSObject <EXTaskConsumerInterface, CLLocationManagerDelegate>
9
9
 
10
- @property (nonatomic, strong) id<UMTaskInterface> task;
10
+ @property (nonatomic, strong) id<EXTaskInterface> task;
11
11
 
12
12
  @end
13
13
 
@@ -5,9 +5,9 @@
5
5
  #import <CoreLocation/CLErrorDomain.h>
6
6
 
7
7
  #import <ExpoModulesCore/EXUtilities.h>
8
+ #import <ExpoModulesCore/EXTaskInterface.h>
8
9
  #import <EXLocation/EXLocation.h>
9
10
  #import <EXLocation/EXGeofencingTaskConsumer.h>
10
- #import <UMTaskManagerInterface/UMTaskInterface.h>
11
11
 
12
12
  @interface EXGeofencingTaskConsumer ()
13
13
 
@@ -24,7 +24,7 @@
24
24
  [self reset];
25
25
  }
26
26
 
27
- # pragma mark - UMTaskConsumerInterface
27
+ # pragma mark - EXTaskConsumerInterface
28
28
 
29
29
  - (NSString *)taskType
30
30
  {
@@ -37,7 +37,7 @@
37
37
  [self startMonitoringRegionsForTask:self->_task];
38
38
  }
39
39
 
40
- - (void)didRegisterTask:(id<UMTaskInterface>)task
40
+ - (void)didRegisterTask:(id<EXTaskInterface>)task
41
41
  {
42
42
  [self startMonitoringRegionsForTask:task];
43
43
  }
@@ -58,7 +58,7 @@
58
58
  }];
59
59
  }
60
60
 
61
- - (void)startMonitoringRegionsForTask:(id<UMTaskInterface>)task
61
+ - (void)startMonitoringRegionsForTask:(id<EXTaskInterface>)task
62
62
  {
63
63
  [EXUtilities performSynchronouslyOnMainThread:^{
64
64
  CLLocationManager *locationManager = [CLLocationManager new];
@@ -1,13 +1,13 @@
1
1
  // Copyright 2018-present 650 Industries. All rights reserved.
2
2
 
3
3
  #import <CoreLocation/CLLocationManagerDelegate.h>
4
- #import <UMTaskManagerInterface/UMTaskConsumerInterface.h>
4
+ #import <ExpoModulesCore/EXTaskConsumerInterface.h>
5
5
 
6
6
  NS_ASSUME_NONNULL_BEGIN
7
7
 
8
- @interface EXLocationTaskConsumer : NSObject <UMTaskConsumerInterface, CLLocationManagerDelegate>
8
+ @interface EXLocationTaskConsumer : NSObject <EXTaskConsumerInterface, CLLocationManagerDelegate>
9
9
 
10
- @property (nonatomic, strong) id<UMTaskInterface> task;
10
+ @property (nonatomic, strong) id<EXTaskInterface> task;
11
11
 
12
12
  @end
13
13
 
@@ -4,9 +4,9 @@
4
4
  #import <CoreLocation/CLErrorDomain.h>
5
5
 
6
6
  #import <ExpoModulesCore/EXUtilities.h>
7
+ #import <ExpoModulesCore/EXTaskInterface.h>
7
8
  #import <EXLocation/EXLocation.h>
8
9
  #import <EXLocation/EXLocationTaskConsumer.h>
9
- #import <UMTaskManagerInterface/UMTaskInterface.h>
10
10
 
11
11
  @interface EXLocationTaskConsumer ()
12
12
 
@@ -33,14 +33,14 @@
33
33
  [self reset];
34
34
  }
35
35
 
36
- # pragma mark - UMTaskConsumerInterface
36
+ # pragma mark - EXTaskConsumerInterface
37
37
 
38
38
  - (NSString *)taskType
39
39
  {
40
40
  return @"location";
41
41
  }
42
42
 
43
- - (void)didRegisterTask:(id<UMTaskInterface>)task
43
+ - (void)didRegisterTask:(id<EXTaskInterface>)task
44
44
  {
45
45
  [EXUtilities performSynchronouslyOnMainThread:^{
46
46
  CLLocationManager *locationManager = [CLLocationManager new];
@@ -15,7 +15,6 @@ Pod::Spec.new do |s|
15
15
  s.static_framework = true
16
16
 
17
17
  s.dependency 'ExpoModulesCore'
18
- s.dependency 'UMTaskManagerInterface'
19
18
 
20
19
  if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
21
20
  s.source_files = "#{s.name}/**/*.h"
@@ -6,30 +6,30 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64</string>
9
+ <string>ios-arm64_x86_64-simulator</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>EXLocation.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
+ <string>x86_64</string>
15
16
  </array>
16
17
  <key>SupportedPlatform</key>
17
18
  <string>ios</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
18
21
  </dict>
19
22
  <dict>
20
23
  <key>LibraryIdentifier</key>
21
- <string>ios-arm64_x86_64-simulator</string>
24
+ <string>ios-arm64</string>
22
25
  <key>LibraryPath</key>
23
26
  <string>EXLocation.framework</string>
24
27
  <key>SupportedArchitectures</key>
25
28
  <array>
26
29
  <string>arm64</string>
27
- <string>x86_64</string>
28
30
  </array>
29
31
  <key>SupportedPlatform</key>
30
32
  <string>ios</string>
31
- <key>SupportedPlatformVariant</key>
32
- <string>simulator</string>
33
33
  </dict>
34
34
  </array>
35
35
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-location",
3
- "version": "14.1.0",
3
+ "version": "14.2.2",
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/Location.js",
6
6
  "types": "build/Location.d.ts",
@@ -42,11 +42,10 @@
42
42
  "expo-module-scripts": "^2.0.0"
43
43
  },
44
44
  "dependencies": {
45
- "@expo/config-plugins": "^4.0.14",
46
- "unimodules-task-manager-interface": "~7.1.0"
45
+ "@expo/config-plugins": "^4.0.14"
47
46
  },
48
47
  "peerDependencies": {
49
48
  "expo": "*"
50
49
  },
51
- "gitHead": "e1ff1a3d6bc62f374e6947a5e81428a1bb7cfa34"
50
+ "gitHead": "b9d655c1bed682ad8919e071dd923968773f05b5"
52
51
  }
package/src/Location.ts CHANGED
@@ -220,7 +220,7 @@ export async function reverseGeocodeAsync(
220
220
  /**
221
221
  * Checks user's permissions for accessing location.
222
222
  * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).
223
- * @deprecated __Deprecated.__ Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.
223
+ * @deprecated Use [`getForegroundPermissionsAsync`](#locationgetforegroundpermissionsasync) or [`getBackgroundPermissionsAsync`](#locationgetbackgroundpermissionsasync) instead.
224
224
  */
225
225
  export async function getPermissionsAsync(): Promise<LocationPermissionResponse> {
226
226
  console.warn(
@@ -233,7 +233,7 @@ export async function getPermissionsAsync(): Promise<LocationPermissionResponse>
233
233
  /**
234
234
  * Asks the user to grant permissions for location.
235
235
  * @return A promise that fulfills with an object of type [LocationPermissionResponse](#locationpermissionresponse).
236
- * @deprecated __Deprecated.__ Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.
236
+ * @deprecated Use [`requestForegroundPermissionsAsync`](#locationrequestforegroundpermissionsasync) or [`requestBackgroundPermissionsAsync`](#locationrequestbackgroundpermissionsasync) instead.
237
237
  */
238
238
  export async function requestPermissionsAsync(): Promise<LocationPermissionResponse> {
239
239
  console.warn(
@@ -109,14 +109,16 @@ export type LocationOptions = {
109
109
  */
110
110
  accuracy?: LocationAccuracy;
111
111
  /**
112
- * (Android only) Specifies whether to ask the user to turn on improved accuracy location mode
112
+ * Specifies whether to ask the user to turn on improved accuracy location mode
113
113
  * which uses Wi-Fi, cell networks and GPS sensor.
114
- * @default true.
114
+ * @default true
115
+ * @platform android
115
116
  */
116
117
  mayShowUserSettingsDialog?: boolean;
117
118
  /**
118
- * (Android only) Minimum time to wait between each update in milliseconds.
119
+ * Minimum time to wait between each update in milliseconds.
119
120
  * Default value may depend on `accuracy` option.
121
+ * @platform android
120
122
  */
121
123
  timeInterval?: number;
122
124
  /**
@@ -260,6 +262,11 @@ export type LocationObject = {
260
262
  * The time at which this position information was obtained, in milliseconds since epoch.
261
263
  */
262
264
  timestamp: number;
265
+ /**
266
+ * Whether the location coordinates is mocked or not.
267
+ * @platform android
268
+ */
269
+ mocked?: boolean;
263
270
  };
264
271
 
265
272
  // @needsAudit
@@ -475,7 +482,7 @@ export type PermissionDetailsLocationIOS = {
475
482
  // @needsAudit
476
483
  export type PermissionDetailsLocationAndroid = {
477
484
  /**
478
- * @deprecated __Deprecated.__ Use `accuracy` field instead.
485
+ * @deprecated Use `accuracy` field instead.
479
486
  */
480
487
  scope: 'fine' | 'coarse' | 'none';
481
488
  /**