rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 329 forks source link

Google requestLocationUpdates suited for the foreground use cases #192

Closed williambarreiro closed 3 years ago

williambarreiro commented 3 years ago

I notice that the plugin is using requestLocationUpdates from Google FusedLocationProviderClient. However the method documentation states that this method is suited for the foreground use cases. Isn't it a problem?

mehdok commented 3 years ago

Not actually, I changed it in the last commit. Previously I used requestLocationUpdates with a PendingIntent and BroadcaseReceiver to delivering the result. But there was a problem with the newest android version (#169) which forced me to use the other method and eliminate the middle men.

As far as I know, there isn't any problem using this method even when we are in the background, because we have a FourgroundService, this service is responsible for showing the notification and holding the app alive and I moved all the location logics into this service.