Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
This repository was 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

@dimitriospafos

Description

@dimitriospafos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions