expo background location

I trying to track user location in the background using expo-location,
-SDK 41
-platform android
the documentation says that you should request foreground Location

Note : Foreground permissions should be granted before asking for the background permissions (your app can’t obtain background permission without foreground permission).

I followed this approach and the background location work fin with the task manager.
but when I try to remove the location permission from the app setting and request only background location then check the background location permission status using Location.getBackgroundPermissionsAsync() it also grants the permission.

Hey @pina_delivrey, foreground location permission is a requirement to be able to use background location.


hello, my question is when I grant foreground location permission with Location.requestForegroundPermissionsAsync() is the background location permission granted automatically?
because when I grant foreground location then request background location with Location.requestBackgroundPermissionsAsync() the android runtime prompt does not apear?
I am in android 9.

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