Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Background location listening with Geolocator Plugin on iOS and permission When in use

$
0
0

Following the plugin's documentation, I implemented a foreground service on Android to obtain the user's location whenever the app is in the background.

For iOS the plugin has implementation for the background in StartListeningAsync but only works if the user grants permission "always".

After iOS 11, it does not display the request to access the location permission "always" when I call the RequestPermissionsAsync method (Permision.LacationAlways). First the system displays a request for location "WhenInUse" and only after putting the app in the background and returning to the app that the system will display the request "always".

This behavior makes my app not work the first time it is put in the background.

I could send the user to the app's location settings screen but this is no longer allowed by Apple, and sending them to the app's general settings screen is a bad experience for the user.

The ideal behavior would be to request "Always" right from the start or something like what happens in STRAVA (walking tracking app).

In the STRAVA app, when placed in the background, a notification appears at the top saying "STRAVA using your location actively" and continues using the location with the "WhenInUse" permission.

How should I proceed please?


Viewing all articles
Browse latest Browse all 204402

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>