shinyorg / shiny

.NET Framework for Backgrounding & Device Hardware Services (iOS, Android, & Catalyst)

Home Page:https://shinylib.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Issue with foreground service when restarting GPS listener on Android

berhir opened this issue · comments

Component/Nuget

GPS or Geofencing (Shiny.Locations)

What operating system(s) are effected?

  • iOS (13+ supported)
  • Mac Catalyst
  • Android (8+ supported)
  • Windows (.NET 7 Target - only Core is currently supported, BLE is coming)

Version(s) of Operation Systems

Tested with Android 10 and 13

Hosting Model

  • MAUI
  • Native/Classic Xamarin
  • Manual

Steps To Reproduce

  1. Start GPS listener with BackgroundMode = GpsBackgroundMode.Realtime
  2. Stop the GPS listener
  3. Start the GPS listener again with the same config

Expected Behavior

  1. When the GPS listener gets started, the Android foreground service is shown
  2. When the GPS listener gets stopped, the foreground service disappears
  3. And when the GPS listener gets started again, the foreground service is shown again

Actual Behavior

  1. The first step worked in my tests on both Android 10 and 13.

Android 10
2. When the GPS listener gets stopped, the foreground service does NOT disappear

Android 13
2. When the GPS listener gets stopped, the foreground service disappears
3. And when the GPS listener gets started again, the foreground service is NOT shown again

Exception or Log output

No response

Code Sample

https://github.com/berhir/ShinyLocationRestartIssue

Code of Conduct

  • I have supplied a reproducible sample that is NOT FROM THE SHINY SAMPLES!
  • 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)
  • I am Sponsor OR My GitHub account is 30+ days old
  • 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!

Fixed in 3.11