Skip to content

[Question]: Ios background stop location updates #1529

Closed as not planned
Closed as not planned
@tarilo

Description

@tarilo

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Your question

Hello. We have integrated your location library but when the app is switched to the background on an iOS device, the interception of positioning changes stops within a few seconds. It works in the foreground but when the app is minimized it stops.

We have followed your example with the following code.

final LocationSettings locationSettings = LocationSettings(
accuracy: LocationAccuracy.high,
distanceFilter: 100,
);

StreamSubscription positionStream = Geolocator.getPositionStream(locationSettings: locationSettings).listen(
(Position? position) {
print(position == null ? 'Unknown' : 'Geolocator ${position.latitude.toString()}, ${position.longitude.toString()}');
});

info.plist
UIBackgroundModes

fetch
location
processing
remote-notification

How can we use the library so that, when the application is in the background, it does not constantly send position changes to a server?

Thanks

Version

12.0.0

Metadata

Metadata

Assignees

Labels

status: closed (missing info)Indicates the issue was automatically closed due to a lack of information.status: needs more infoWe need more information before we can continue work on this issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions