Fused-Location-API-Example icon indicating copy to clipboard operation
Fused-Location-API-Example copied to clipboard

Background Location Update

Open nidhinprathap opened this issue 4 years ago • 3 comments

In the foreground, the app works beautifully, but as soon as I make the app go to the background, the location updates don't get triggered at all. Have added ACCESS_BACKGROUND_LOCATION permission in Manifest and I'm requesting ACCESS_BACKGROUND_LOCATION permission on App Launch.

Android Manifest <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

PermissionUtils

fun requestAccessFineLocationPermission(activity: AppCompatActivity, requestId: Int) { ActivityCompat.requestPermissions( activity, arrayOf( Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION ), requestId ) }

Am i missing anything here ?

nidhinprathap avatar Mar 31 '20 18:03 nidhinprathap

@nidhinprathap Have you found a solution to make it work in the background?

abuzed avatar Nov 17 '20 15:11 abuzed

Manully giving the APP permission to use GPS always doesnt help either, so it must be something with the code not including background updates

Conver avatar Jul 15 '21 13:07 Conver

@mishra3452, you think it's possible to add so that background updates work too?

Conver avatar Jul 16 '21 12:07 Conver