expo-location 16.5.3 → 16.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 16.5.4 — 2024-02-27
14
+
15
+ ### 🎉 New features
16
+
17
+ - [Android] Make foreground service permission opt-in with `isAndroidForegroundServiceEnabled` config plugin option [#27265](https://github.com/expo/expo/pull/27265) by [@brentvatne](https://github.com/brentvatne))
18
+
13
19
  ## 16.5.3 — 2024-02-06
14
20
 
15
21
  ### 🐛 Bug fixes
package/README.md CHANGED
@@ -51,13 +51,14 @@ This module requires the permissions for approximate and exact device location.
51
51
  <!-- Added permissions -->
52
52
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
53
53
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
54
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
55
54
 
56
55
  <!-- Optional permissions -->
56
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
57
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
57
58
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
58
59
  ```
59
60
 
60
- > **Note:** on Android, you have to [submit your app for review and request access to use the background location permission](https://support.google.com/googleplay/android-developer/answer/9799150?hl=en).
61
+ > **Note:** on Android, you have to [submit your app for review and request access to use the background location permission](https://support.google.com/googleplay/android-developer/answer/9799150?hl=en) or [foreground location permissions](https://support.google.com/googleplay/android-developer/answer/13392821?hl=en).
61
62
 
62
63
  # Contributing
63
64
 
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '16.5.3'
6
+ version = '16.5.4'
7
7
 
8
8
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
9
  if (expoModulesCorePlugin.exists()) {
@@ -94,7 +94,7 @@ android {
94
94
  namespace "expo.modules.location"
95
95
  defaultConfig {
96
96
  versionCode 29
97
- versionName "16.5.3"
97
+ versionName "16.5.4"
98
98
  }
99
99
  }
100
100
 
@@ -1,8 +1,6 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
2
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
3
3
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
4
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
5
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
6
4
 
7
5
  <application>
8
6
  <service
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-location",
3
- "version": "16.5.3",
3
+ "version": "16.5.4",
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",
@@ -44,5 +44,5 @@
44
44
  "peerDependencies": {
45
45
  "expo": "*"
46
46
  },
47
- "gitHead": "4f3dcf3e23eae997f884117fdd34ad734efad9fd"
47
+ "gitHead": "e94e2aac39cbb7f8788869cd6798bbdeadc58f42"
48
48
  }
@@ -5,5 +5,6 @@ declare const _default: ConfigPlugin<void | {
5
5
  locationWhenInUsePermission?: string | undefined;
6
6
  isIosBackgroundLocationEnabled?: boolean | undefined;
7
7
  isAndroidBackgroundLocationEnabled?: boolean | undefined;
8
+ isAndroidForegroundServiceEnabled?: boolean | undefined;
8
9
  }>;
9
10
  export default _default;
@@ -14,7 +14,7 @@ const withBackgroundLocation = (config) => {
14
14
  return config;
15
15
  });
16
16
  };
17
- const withLocation = (config, { locationAlwaysAndWhenInUsePermission, locationAlwaysPermission, locationWhenInUsePermission, isIosBackgroundLocationEnabled, isAndroidBackgroundLocationEnabled, } = {}) => {
17
+ const withLocation = (config, { locationAlwaysAndWhenInUsePermission, locationAlwaysPermission, locationWhenInUsePermission, isIosBackgroundLocationEnabled, isAndroidBackgroundLocationEnabled, isAndroidForegroundServiceEnabled, } = {}) => {
18
18
  if (isIosBackgroundLocationEnabled) {
19
19
  config = withBackgroundLocation(config);
20
20
  }
@@ -34,11 +34,14 @@ const withLocation = (config, { locationAlwaysAndWhenInUsePermission, locationAl
34
34
  return config;
35
35
  });
36
36
  return config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
37
+ // Note: these are already added in the library AndroidManifest.xml and so
38
+ // are not required here, we may want to remove them in the future.
37
39
  'android.permission.ACCESS_COARSE_LOCATION',
38
40
  'android.permission.ACCESS_FINE_LOCATION',
39
- 'android.permission.FOREGROUND_SERVICE',
40
- // Optional
41
+ // These permissions are optional, and not listed in the library AndroidManifest.xml
41
42
  isAndroidBackgroundLocationEnabled && 'android.permission.ACCESS_BACKGROUND_LOCATION',
43
+ isAndroidForegroundServiceEnabled && 'android.permission.FOREGROUND_SERVICE',
44
+ isAndroidForegroundServiceEnabled && 'android.permission.FOREGROUND_SERVICE_LOCATION',
42
45
  ].filter(Boolean));
43
46
  };
44
47
  exports.default = (0, config_plugins_1.createRunOncePlugin)(withLocation, pkg.name, pkg.version);
@@ -27,6 +27,7 @@ const withLocation: ConfigPlugin<
27
27
  locationWhenInUsePermission?: string;
28
28
  isIosBackgroundLocationEnabled?: boolean;
29
29
  isAndroidBackgroundLocationEnabled?: boolean;
30
+ isAndroidForegroundServiceEnabled?: boolean;
30
31
  } | void
31
32
  > = (
32
33
  config,
@@ -36,6 +37,7 @@ const withLocation: ConfigPlugin<
36
37
  locationWhenInUsePermission,
37
38
  isIosBackgroundLocationEnabled,
38
39
  isAndroidBackgroundLocationEnabled,
40
+ isAndroidForegroundServiceEnabled,
39
41
  } = {}
40
42
  ) => {
41
43
  if (isIosBackgroundLocationEnabled) {
@@ -62,11 +64,14 @@ const withLocation: ConfigPlugin<
62
64
  return AndroidConfig.Permissions.withPermissions(
63
65
  config,
64
66
  [
67
+ // Note: these are already added in the library AndroidManifest.xml and so
68
+ // are not required here, we may want to remove them in the future.
65
69
  'android.permission.ACCESS_COARSE_LOCATION',
66
70
  'android.permission.ACCESS_FINE_LOCATION',
67
- 'android.permission.FOREGROUND_SERVICE',
68
- // Optional
71
+ // These permissions are optional, and not listed in the library AndroidManifest.xml
69
72
  isAndroidBackgroundLocationEnabled && 'android.permission.ACCESS_BACKGROUND_LOCATION',
73
+ isAndroidForegroundServiceEnabled && 'android.permission.FOREGROUND_SERVICE',
74
+ isAndroidForegroundServiceEnabled && 'android.permission.FOREGROUND_SERVICE_LOCATION',
70
75
  ].filter(Boolean) as string[]
71
76
  );
72
77
  };