Flutter Dev
Flutter Dev

Reputation: 568

How to update the user location with Geolocator if the app is in the Foreground?

The app should update the rider's location every second whatever the app is alive or in the foreground, I tried to install the Geolocator and it succeed but whenever the app is in that background or in the Foreground it stops responding.How to solve with that issue.

Some recommend me to work with workmanager !?

Upvotes: 0

Views: 2588

Answers (2)

Deepanjali Tripathi
Deepanjali Tripathi

Reputation: 113

Push the latitude and longitude of the device from within the background service using background_locater plugin

Upvotes: 3

Mudassir Khan
Mudassir Khan

Reputation: 41

To push location in foreground through foreground service and even when device reboots you can use following library

https://pub.dev/packages/background_locator

Upvotes: 2

Related Questions