diff --git a/src/Geolocator.Plugin/Abstractions/ListenerSettings.shared.cs b/src/Geolocator.Plugin/Abstractions/ListenerSettings.shared.cs index 6a2a4ee..51d0782 100644 --- a/src/Geolocator.Plugin/Abstractions/ListenerSettings.shared.cs +++ b/src/Geolocator.Plugin/Abstractions/ListenerSettings.shared.cs @@ -42,5 +42,11 @@ public class ListenerSettings /// /// The time between updates (default: 5 minutes). public TimeSpan? DeferralTime { get; set; } = TimeSpan.FromMinutes(5); + + /// + /// A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background. (>= iOS 11). Default: false + /// + public bool ShowsBackgroundLocationIndicator { get; set; } = false; + } } \ No newline at end of file diff --git a/src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs b/src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs index 37287ba..e55e476 100644 --- a/src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs +++ b/src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs @@ -401,6 +401,9 @@ public async Task StartListeningAsync(TimeSpan minimumTime, double minimum // set background flag #if __IOS__ + if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) + manager.ShowsBackgroundLocationIndicator = listenerSettings.ShowsBackgroundLocationIndicator; + if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0)) manager.AllowsBackgroundLocationUpdates = listenerSettings.AllowBackgroundUpdates;