From b8b8275d0cbb44e201f6e8bfa57047d2398c45f6 Mon Sep 17 00:00:00 2001 From: tim Hoogstrate Date: Tue, 20 May 2025 12:52:30 +0200 Subject: [PATCH] updates afp Android example app and README --- geolocator/CHANGELOG.md | 5 +++++ geolocator/README.md | 7 +++++++ .../example/android/app/src/main/AndroidManifest.xml | 2 ++ geolocator/pubspec.yaml | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/geolocator/CHANGELOG.md b/geolocator/CHANGELOG.md index fce75297a..171cec317 100644 --- a/geolocator/CHANGELOG.md +++ b/geolocator/CHANGELOG.md @@ -1,3 +1,8 @@ +## 14.0.1 + +- Adds section about `FOREGROUND_SERVICE_LOCATION` to the README. +- Fixes PlatformException in example app for Android 14 (SDK level 34) and newer by updating manifest permissions. + ## 14.0.0 - **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. diff --git a/geolocator/README.md b/geolocator/README.md index d703b5ddc..07ba2c081 100644 --- a/geolocator/README.md +++ b/geolocator/README.md @@ -68,6 +68,13 @@ Starting from Android 10 you need to add the `ACCESS_BACKGROUND_LOCATION` permis ``` +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: + [FOREGROUND_SERVICE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_LOCATION) + + ``` xml + **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). diff --git a/geolocator/example/android/app/src/main/AndroidManifest.xml b/geolocator/example/android/app/src/main/AndroidManifest.xml index 3e48a8e88..d7287cbee 100644 --- a/geolocator/example/android/app/src/main/AndroidManifest.xml +++ b/geolocator/example/android/app/src/main/AndroidManifest.xml @@ -8,6 +8,8 @@ + +