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

Android Pie Not Getting Current Location in App Background Sleep Mode

$
0
0

Hi Friends,

I want to get current location, when app went into sleep mode or Background.Currently i am using > Plugin.Geolocator.CrossGeolocator.Current DLL in App OnSleep() , But Its Working Till Android 8.1 but Android Pie Not updating current Location Values.. How to Achieve in Android Pie?

My Code:
var minute = TimeSpan.FromSeconds(30);
Device.StartTimer(minute, () =>
 { 
await Task.Run(async () =>
 {
TimeSpan t = TimeSpan.FromSeconds(10);
 var locator = Plugin.Geolocator.CrossGeolocator.Current;
locator.DesiredAccuracy = 5;
   var position = await locator.GetPositionAsync(timeout: t); 
//API Method
 });
 });

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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