Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Ios background stop location updates #1529

Closed
3 of 8 tasks
tarilo opened this issue Jun 14, 2024 · 8 comments
Closed
3 of 8 tasks

[Question]: Ios background stop location updates #1529

tarilo opened this issue Jun 14, 2024 · 8 comments
Assignees
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.

Comments

@tarilo
Copy link

tarilo commented Jun 14, 2024

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

@mayank-vinove
Copy link

same issue.

when app killed in IOS , unable to listen location updates.

@tarilo
Copy link
Author

tarilo commented Jun 17, 2024

Hi @mayank-vinove

With the app. in background you can listen location changes after 5 secs?

@mayank-vinove
Copy link

As per my understanding minimum interval is 15 min but iam unable to get a callback after every ~15 min.

@tarilo
Copy link
Author

tarilo commented Jun 17, 2024

But there are a multitude of apps with background tracking like Google Maps, Waze, Uber, etc. I think there is a way to be able to track location in the background, for example for interaction with beacons.

@tarilo
Copy link
Author

tarilo commented Jun 18, 2024

No coments?

@TimHoogstrate
Copy link
Contributor

Dear @tarilo,

Can you check if it works as expected in the supplied example app? Also check if you requested the correct permissions and added the correct permission to the pod file. Furthermore, check if you used the correct plist entries.

Kind regards,

@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Jul 29, 2024
@TimHoogstrate TimHoogstrate self-assigned this Jul 29, 2024
@aanelson
Copy link

aanelson commented Aug 8, 2024

@tarilo This plugin does not have any reference to https://developer.apple.com/documentation/corelocation/cllocationmanager/startmonitoringsignificantlocationchanges()
which is probably what you are looking for. This is the api that allows terminated apps to start and receive notification changes when the location has changed.

edit: Some new iOS apis support restarting the process when the app is terminated #1567

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Aug 8, 2024
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Aug 20, 2024
Copy link

github-actions bot commented Sep 3, 2024

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.

@github-actions github-actions bot added the status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. label Sep 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: closed (missing info) Indicates the issue was automatically closed due to a lack of information. status: needs more info We need more information before we can continue work on this issue.
Projects
None yet
Development

No branches or pull requests

4 participants