Skip to content

Commit

Permalink
Merge branch 'main' into feature/gnss_satellites_in_view
Browse files Browse the repository at this point in the history
# Conflicts:
#	geolocator_android/CHANGELOG.md
#	geolocator_android/pubspec.yaml
  • Loading branch information
TimHoogstrate committed Jan 17, 2024
2 parents be3e53f + ff5be16 commit 4ae7e35
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 26 deletions.
8 changes: 8 additions & 0 deletions geolocator/example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
Expand All @@ -15,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
4 changes: 4 additions & 0 deletions geolocator_android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* Creates `AndroidPosition`, a child class of `Position` with Android specific properties.
* Adds the `satelliteCount` and `satellitesUsedInFix` to `AndroidPosition`.

## 4.4.1

* Fixes a bug where `getPositionStream` caused an `java.lang.IllegalStateException: passive location requests must have an explicit minimum update interval` because `minUpdateIntervalMillis` property in location request was set to -1 by default

## 4.4.0

- Adds `color` to `ForegroundNotificationConfig` to set the color of the notification icon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public void startPositionUpdates(

final LocationRequestCompat locationRequest = new LocationRequestCompat.Builder(timeInterval)
.setMinUpdateDistanceMeters(distanceFilter)
.setMinUpdateIntervalMillis(timeInterval)
.setQuality(quality)
.build();

Expand Down
13 changes: 13 additions & 0 deletions geolocator_apple/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 2.3.5

* Previously the plugin filtered out negative values for heading and/or heading accuracy. Now the plugin is returning the heading and/or the heading accuracy even if the they have a negative value (invalid), so that the developer can use it and decide what to do with it.

## 2.3.4

* Allows the ARM64 architecture as a valid IPhone simulator architecture.

## 2.3.3

* Ensures the `[CLLocationManager locationServicesEnabled]` message is called
on a background thread when listening for service updates.

## 2.3.2

* Fixes build error and warnings regarding unused variables and unavailable APIs on macOS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ - (FlutterError * _Nullable)onListenWithArguments:(id _Nullable)arguments eventS
}

- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status{
if ([CLLocationManager locationServicesEnabled]) {
_eventSink([NSNumber numberWithInt:(ServiceStatus)enabled]);
} else {
_eventSink([NSNumber numberWithInt:(ServiceStatus)disabled]);
}
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL isEnabled = [CLLocationManager locationServicesEnabled];
dispatch_async(dispatch_get_main_queue(), ^(void) {
if (isEnabled) {
self->_eventSink([NSNumber numberWithInt:(ServiceStatus)enabled]);
} else {
self->_eventSink([NSNumber numberWithInt:(ServiceStatus)disabled]);
}
});
});
}

@end
14 changes: 4 additions & 10 deletions geolocator_apple/ios/Classes/Utils/LocationMapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,10 @@ + (NSDictionary *) toDictionary:(CLLocation *)location {
// - https://developer.apple.com/documentation/corelocation/cllocation/1423832-course?language=objc
// - https://developer.apple.com/documentation/corelocation/cllocation/3524338-courseaccuracy?language=objc
double heading = location.course;
if (heading >= 0.0) {
if (@available(iOS 13.4, macOS 10.15.4, *)) {
double headingAccuracy = location.courseAccuracy;
if (headingAccuracy >= 0.0) {
[locationMap setObject:@(heading) forKey: @"heading"];
[locationMap setObject:@(headingAccuracy) forKey: @"heading_accuracy"];
}
} else {
[locationMap setObject:@(heading) forKey: @"heading"];
}
[locationMap setObject:@(heading) forKey: @"heading"];
if (@available(iOS 13.4, macOS 10.15.4, *)) {
double headingAccuracy = location.courseAccuracy;
[locationMap setObject:@(headingAccuracy) forKey: @"heading_accuracy"];
}

if(@available(iOS 15.0, macOS 12.0, *)) {
Expand Down
2 changes: 1 addition & 1 deletion geolocator_apple/ios/geolocator_apple.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Pod::Spec.new do |s|
s.platform = :ios, '8.0'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386'}
end
2 changes: 1 addition & 1 deletion geolocator_apple/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: geolocator_apple
description: Geolocation Apple plugin for Flutter. This plugin provides the Apple implementation for the geolocator.
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator_apple
issue_tracker: https://github.com/baseflow/flutter-geolocator/issues?q=is%3Aissue+is%3Aopen
version: 2.3.2
version: 2.3.5

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions geolocator_linux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0+1

- Ensures the `Position` instance always contains a timestamp.

## 0.2.0

- Bumps `geolocator_platform_interface` dependency to `^4.1.0`.
Expand Down
2 changes: 1 addition & 1 deletion geolocator_linux/lib/src/geoclue_x.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension GeoCluePosition on GeoClueLocation {
headingAccuracy: 0,
latitude: latitude,
longitude: longitude,
timestamp: timestamp,
timestamp: timestamp ?? DateTime.now(),
speed: speed ?? 0,
speedAccuracy: 0,
);
Expand Down
2 changes: 1 addition & 1 deletion geolocator_linux/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Geolocation Linux plugin for Flutter. This plugin provides the
Linux implementation for the geolocator.
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator_linux
issue_tracker: https://github.com/baseflow/flutter-geolocator/issues?q=is%3Aissue+is%3Aopen
version: 0.2.0
version: 0.2.0+1

environment:
sdk: '>=2.15.0 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions geolocator_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.2.0

- Replaces an optional DateTime? `timestamp` in `Position` object for an NonNull DateTime `timestamp`.

## 4.1.1

- Updates dependencies to latest versions to prevent conflicts with other packages.
Expand Down
11 changes: 5 additions & 6 deletions geolocator_platform_interface/lib/src/models/position.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Position {
final double longitude;

/// The time at which this position was determined.
final DateTime? timestamp;
final DateTime timestamp;

/// The altitude of the device in meters.
///
Expand Down Expand Up @@ -141,10 +141,9 @@ class Position {
'The supplied map doesn\'t contain the mandatory key `longitude`.');
}

final timestamp = positionMap['timestamp'] != null
? DateTime.fromMillisecondsSinceEpoch(positionMap['timestamp'].toInt(),
isUtc: true)
: null;
final timestamp = DateTime.fromMillisecondsSinceEpoch(
positionMap['timestamp'].toInt(),
isUtc: true);

return Position(
latitude: positionMap['latitude'],
Expand All @@ -167,7 +166,7 @@ class Position {
Map<String, dynamic> toJson() => {
'longitude': longitude,
'latitude': latitude,
'timestamp': timestamp?.millisecondsSinceEpoch,
'timestamp': timestamp.millisecondsSinceEpoch,
'accuracy': accuracy,
'altitude': altitude,
'altitude_accuracy': altitudeAccuracy,
Expand Down
2 changes: 1 addition & 1 deletion geolocator_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A common platform interface for the geolocator plugin.
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 4.1.1
version: 4.2.0

dependencies:
flutter:
Expand Down

0 comments on commit 4ae7e35

Please sign in to comment.