Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Android foregroundService location requests while screen is off for a while not working #275

Open
dimitriospafos opened this issue Jan 29, 2021 · 1 comment

Comments

@dimitriospafos
Copy link

Which platform(s) does your issue occur on?

  • Android

I have a foreground service running on android which get's the user's geolocation upon connecting to a bluetooth device. I'm using the "getCurrentLocation" which is provided by the geolocation plugin.

Everything works fine except one case:
App is open -> Works as expected
App is closed but screen is on -> Works as expected
App is killed but screen is on -> Works as expected
App is killed but screen is off for some time -> The Foreground service is unable to get the location

Based on my findings it seems like there are two methods that the Android API provides: https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderClient.html#requestLocationUpdates(com.google.android.gms.location.LocationRequest,%20android.app.PendingIntent)
Screen Shot 2021-01-28 at 10 40 01 PM

In the geolocation plugin the "requestLocationUpdates" is using the first method without the "PendingIntent". Is there plan to add the functionality that uses the second method of the Android API which uses the "PendingIntent"?
Screen Shot 2021-01-28 at 10 36 32 PM

@Amira-tageldin
Copy link

Any update here?

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

No branches or pull requests

2 participants