run the app and click "Start" Button and minimize or run the app on the background
Expected Behavior
The app send geolocation running under background.
Actual Behavior
The app does not send geolocation.
Exception or Log output
No response
Code Sample
public interface ILocationService
{
Task StartListener();
Task StopListener();
}
public class LocationService : ILocationService
{
private readonly IGpsManager gpsManager;
public LocationService(IGpsManager gpsManager)
{
this.gpsManager = gpsManager;
}
public Task StartListener()
{
if (gpsManager.CurrentListener is not null)
return Task.CompletedTask;
return gpsManager.StartListener(new GpsRequest
{
BackgroundMode = GpsBackgroundMode.Realtime,
Accuracy = GpsAccuracy.High,
});
}
public Task StopListener()
{
return gpsManager.StopListener();
}
}
public partial class MainPage : ContentPage
{
int count = 0;
// IServiceTest Services;
ILocationService svc;
public MainPage(ILocationService _svc)
{
InitializeComponent();
svc = _svc;
}
//method to start manually foreground service
private void OnServiceStartClicked(object sender, EventArgs e)
{
svc.StartListener();
}
//method to stop manually foreground service
private void OnServiceStopClicked(object sender, EventArgs e)
{
svc.StopListener();
}
}
Code of Conduct
[X] I have supplied a reproducible sample that is NOT FROM THE SHINY SAMPLES!
[X] I am a Sponsor OR I am using the LATEST stable/beta version from nuget (v3.0 stable - ALPHAS are not taking issues - Sponsors can still send v2 issues)
[X] I am Sponsor OR My GitHub account is 30+ days old
[X] I understand that if I am checking these boxes and I am not actually following what they are saying, I will be removed from this repository!
Component/Nuget
GPS or Geofencing (Shiny.Locations)
What operating system(s) are effected?
Version(s) of Operation Systems
3.0
Hosting Model
Steps To Reproduce
run the app and click "Start" Button and minimize or run the app on the background
Expected Behavior
The app send geolocation running under background.
Actual Behavior
The app does not send geolocation.
Exception or Log output
No response
Code Sample
public interface ILocationService { Task StartListener(); Task StopListener();
} public class LocationService : ILocationService { private readonly IGpsManager gpsManager;
}
public partial class MainPage : ContentPage { int count = 0; // IServiceTest Services; ILocationService svc; public MainPage(ILocationService _svc) { InitializeComponent(); svc = _svc;
} //method to start manually foreground service private void OnServiceStartClicked(object sender, EventArgs e) { svc.StartListener(); }
}
Code of Conduct