You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Go to `https://github.com/BaseflowIT/flutter-geolocator` and click the "Compare & pull request" button.
48
48
49
-
Please make sure you solved all warnings and errors reported by the static code analyses and that you fill in the full pull request template. Failing to do so will result in us asking you to fix it.
49
+
Please make sure you solved all warnings and errors reported by the static code analyses and that you fill in the full pull request template. Failing to do so will result in us asking you to fix it.
Copy file name to clipboardExpand all lines: geolocator/CHANGELOG.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,54 @@
1
+
## NEXT
2
+
3
+
- Adds section about `UIBackgroundModes` to the README.
4
+
5
+
## 14.0.1
6
+
7
+
- Adds section about `FOREGROUND_SERVICE_LOCATION` to the README.
8
+
- Fixes PlatformException in example app for Android 14 (SDK level 34) and newer by updating manifest permissions.
9
+
10
+
## 14.0.0
11
+
12
+
-**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.
13
+
- Bump `flutter_lints` to version of afp to 5.0.0
14
+
- Updated `geolocator_android` dependency to version `^5.0.0`
15
+
16
+
## 13.0.4
17
+
18
+
- Bump `flutter_lints` to version 5.0.0. Later added: of afp example project.
19
+
20
+
## 13.0.3
21
+
22
+
- Updates dart sdk to `sdk: ^3.5.0`
23
+
- Updates example project and fixes analyzer issues
24
+
25
+
## 13.0.2
26
+
27
+
- Updates dependency on geolocator_apple to version 2.3.8.
28
+
- Migrates Android configuration of example app away from imperative gradle API.
29
+
30
+
## 13.0.1
31
+
32
+
- Resolves problems when compiling non-web platforms because of illegal reference to `dart:js_interop`.
33
+
34
+
## 13.0.0
35
+
36
+
-**BREAKING CHANGE:** Deprecates getCurrentPosition desiredAccuracy, forceAndroidLocationManager, and timeLimit parameters in favor of supplying a LocationSettings class.
37
+
- Exposes `WebSettings` from geolocator.
38
+
- Updates dependency on geolocator_web to version 4.1.0
39
+
- Updates dependency on geolocator_android to version 4.3.0
40
+
- Updates dependency on geolocator_apple to version 2.3.7
41
+
- Updates dependency on geolocator_windows to version 0.2.3
42
+
- Updates dependency on geolocator_platform_interface to version 4.2.3
43
+
44
+
## 12.0.0
45
+
46
+
-**BREAKING CHANGE:** Updates dependency on geolocator_web to version [4.0.0](https://pub.dev/packages/geolocator_web/changelog).
47
+
48
+
## 11.1.0
49
+
50
+
- Expose `AndroidPosition` from geolocator.
51
+
1
52
## 11.0.0
2
53
3
54
-**BREAKING CHANGE:** Updates dependency on geolocator_web to version [3.0.0](https://pub.dev/packages/geolocator_web/changelog).
Starting from Android 10 you need to add the `ACCESS_BACKGROUND_LOCATION` permission (next to the `ACCESS_COARSE_LOCATION` or the `ACCESS_FINE_LOCATION` permission) if you want to continue receiving updates even when your App is running in the background (note that the geolocator plugin doesn't support receiving and processing location updates while running in the background):
65
+
Starting from Android 10 you need to add the `ACCESS_BACKGROUND_LOCATION` permission (next to the `ACCESS_COARSE_LOCATION` or the `ACCESS_FINE_LOCATION` permission) if you want to continue receiving updates even when your App is running in the background:
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:
> **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).
72
79
73
80
@@ -76,7 +83,7 @@ Starting from Android 10 you need to add the `ACCESS_BACKGROUND_LOCATION` permis
76
83
<details>
77
84
<summary>iOS</summary>
78
85
79
-
On iOS you'll need to add the following entry to your Info.plist file (located under ios/Runner) in order to access the device's location. Simply open your Info.plist file and add the following (make sure you update the description so it is meaningfull in the context of your App):
86
+
On iOS you'll need to add the following entry to your Info.plist file (located under ios/Runner) in order to access the device's location. Simply open your Info.plist file and add the following (make sure you update the description so it is meaningful in the context of your App):
80
87
81
88
``` xml
82
89
<key>NSLocationWhenInUseUsageDescription</key>
@@ -116,6 +123,15 @@ The second key (in this example called `YourPurposeKey`) should match the purpos
116
123
> NOTE: the first time requesting temporary full accuracy access it might take several seconds for the pop-up to show. This is due to the fact that iOS is determining the exact user location which may take several seconds. Unfortunately this is out of our hands.
117
124
</details>
118
125
126
+
On iOS 16 and above you need to specify `UIBackgroundModes``location` to receive location updates in the background.
To query the current location of the device simply make a call to the `getCurrentPosition` method. You can finetune the results by specifying the following parameters:
229
245
230
246
-`desiredAccuracy`: the accuracy of the location data that your app wants to receive;
231
-
-`timeLimit`: the maximum amount of time allowed to acquire the current location. When the time limit is passed a `TimeOutException` will be thrown and the call will be cancelled. By default no limit is configured.
247
+
-`timeLimit`: the maximum amount of time allowed to acquire the current location. When the time limit is passed a `TimeoutException` will be thrown and the call will be cancelled. By default no limit is configured.
232
248
233
249
```dart
234
250
import 'package:geolocator/geolocator.dart';
235
251
236
-
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
252
+
final LocationSettings locationSettings = LocationSettings(
253
+
accuracy: LocationAccuracy.high,
254
+
distanceFilter: 100,
255
+
);
256
+
257
+
Position position = await Geolocator.getCurrentPosition(locationSettings: locationSettings);
237
258
```
238
259
239
260
#### Last known location
@@ -252,7 +273,7 @@ To listen for location changes you can call the `getPositionStream` to receive s
252
273
253
274
-`accuracy`: the accuracy of the location data that your app wants to receive;
254
275
-`distanceFilter`: the minimum distance (measured in meters) a device must move horizontally before an update event is generated;
255
-
-`timeLimit`: the maximum amount of time allowed between location updates. When the time limit is passed a `TimeOutException` will be thrown and the stream will be cancelled. By default no limit is configured.
276
+
-`timeLimit`: the maximum amount of time allowed between location updates. When the time limit is passed a `TimeoutException` will be thrown and the stream will be cancelled. By default no limit is configured.
In certain situation it is necessary to specify some platform specific settings. This can be accomplished using the platform specific `AndroidSettings` or `AppleSettings` classes. When using a platform specific class, the platform specific package must be imported as well. For example:
291
+
### Platform specific location settings
292
+
293
+
In certain situation it is necessary to specify some platform specific settings. This can be accomplished using the platform specific `AndroidSettings`, `AppleSettings` and `WebSettings` classes. When using a platform specific class, the platform specific package must be imported as well. For example:
0 commit comments