Skip to content

Commit 3567ef9

Browse files
updates afp Android example app and README (#1707)
1 parent 049fa9f commit 3567ef9

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

geolocator/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 14.0.1
2+
3+
- Adds section about `FOREGROUND_SERVICE_LOCATION` to the README.
4+
- Fixes PlatformException in example app for Android 14 (SDK level 34) and newer by updating manifest permissions.
5+
16
## 14.0.0
27

38
- **BREAKING CHANGE:** for Flutter `3.27.0` and below. Make sure you'll upgrade Flutter to `3.29.0` or above before using this version.

geolocator/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ Starting from Android 10 you need to add the `ACCESS_BACKGROUND_LOCATION` permis
6868
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
6969
```
7070

71+
Starting from Android 14 (SDK 34) you need to add the `FOREGROUND_SERVICE_LOCATION` permission (next to the `ACCESS_COARSE_LOCATION` or the `ACCESS_FINE_LOCATION` or the `ACCESS_BACKGROUND_LOCATION` permission) if you want to continue receiving updates even when your App is running in the foreground:
72+
[FOREGROUND_SERVICE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_LOCATION)
73+
74+
``` xml
75+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION"
76+
```
77+
7178
> **NOTE:** Specifying the `ACCESS_COARSE_LOCATION` permission results in location updates with an accuracy approximately equivalent to a city block. It might take a long time (minutes) before you will get your first locations fix as `ACCESS_COARSE_LOCATION` will only use the network services to calculate the position of the device. More information can be found [here](https://developer.android.com/training/location/retrieve-current#permissions).
7279

7380

geolocator/example/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<!-- Permissions options for the `location` group -->
1010
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
11+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
12+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
1113

1214
<application
1315
android:name="${applicationName}"

geolocator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: geolocator
22
description: Geolocation plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API for generic location (GPS etc.) functions.
33
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator
44
issue_tracker: https://github.com/baseflow/flutter-geolocator/issues?q=is%3Aissue+is%3Aopen
5-
version: 14.0.0
5+
version: 14.0.1
66

77
environment:
88
sdk: ^3.5.0

0 commit comments

Comments
 (0)