Location.startLocationUpdatesAsync not working when minimized

Hello. I have a problem regarding expo latest API /Feature . Firstly, expo API background location works perfectly on Android Version 5.0(Lolipop) and 6.0(Marshmallow). We don’t need to open another third party map application except Android 7.0 And Above. When i try to minimize/open another app, the location services is paused. Please watch closely the gif that I uploaded here . Watch the gps icon at the header of the phone when I minimize the app. I hope expo team would give attention to this problem. Thanks! . .

Hey @mfakhruddin391,

Have you managed to replicate this on multiple Android devices or has it only occurred on the one from your video?

Cheers,
Adam

Yes . Like i said before ,

expo API background location works perfectly on Android Version 5.0(Lolipop) and 6.0(Marshmallow)

But not working on Android version 7.0 and above(8 & 9) . I tried on my second device which is android version 5. its working . (the given gif above is actual footage from real device Android version 8.0 , not from emulator)

Did you manage to make it work? Got exactly same problem and I can’t find any workaround.

Yes of course. I tried and struggling to find another way . Im trying to analyze how google maps and waze can keep the gps on while on background mode. Maybe it has related to push notifications or they attach the location.startlocationupdateasync somewhere inside local notification , because based on my observation , the only things that can bypass when the smartphone in lock mode is notifications.?

I tried to use expo sdk 32.0 notifications to keep location service available but it didn’t work. I have no idea how to make it work…

Unfortunately, on Androids above 8.0 it’s required to have a sticky notification and foreground service running to keep the location services as active as in the foreground state. I’ve been working on a new feature allowing to do this, but had to hold off it to work on some other, more urgent stuff :wink: Anyway, I hope to get it done before next release :smile:

6 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.