android / location-samples

Multiple samples showing the best practices in location APIs on Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibility to use standard LocationManager for Foreground Service sample

vshcherb opened this issue · comments

Hello,
Is it possible to use standard LocationManager for Foreground Service Sample instead of GMS FusedLocationProviderClient.

https://github.com/android/location-samples/blob/main/LocationUpdatesForegroundService/app/src/main/java/com/google/android/gms/location/sample/locationupdatesforegroundservice/LocationUpdatesService.java#L116

The question comes from point that we have foreground service but it uses LocationManager (we don't want to use dependency to GMS) and the app is constantly getting rejected by Google Play saying we use location in background. So I wonder if it this sample (link from official documentation) says you should always from Android 10 FusedLocationProviderClient if you want your service to be working