Skip to content

Problem with background on iOS #27

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

Closed
nicop2000 opened this issue Nov 20, 2021 · 1 comment
Closed

Problem with background on iOS #27

nicop2000 opened this issue Nov 20, 2021 · 1 comment

Comments

@nicop2000
Copy link

Hi, I use the GeoLocator's position stream and send the updates to the foreground task receiveport which I listen to. On Android it works fine but on iOS it stops after about 10-15 seconds after returning to the home screen. Any ideas how to fix this?

Geolocator.getPositionStream(intervalDuration: Duration(seconds: 1)).listen((event) {
      print(event);
      sendPort!.send(event);
    });
_receivePort = receivePort;
      _receivePort!.listen((message) {
        print("RECIEVE PORT");
        print(message);
      });

Thanks anyway :)

@Dev-hwang
Copy link
Owner

Dev-hwang commented Nov 22, 2021

@nicop2000

As explained by README, the iOS platform has limitations on background processing. Therefore, the task stops after 15-30 seconds in the background. But in the foreground it works fine.

At my current level, there is no way to solve it. If there is a way to solve the problem, please provide a PR, I would appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants