Skip to content

Commit 4eaf320

Browse files
Merge pull request #314 from nicolas-garcia/master
Exposing CLLocationManager.ShowsBackgroundLocationIndicator into ListenerSettings
2 parents 549cadf + ef24222 commit 4eaf320

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Geolocator.Plugin/Abstractions/ListenerSettings.shared.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,11 @@ public class ListenerSettings
4242
/// </summary>
4343
/// <value>The time between updates (default: 5 minutes).</value>
4444
public TimeSpan? DeferralTime { get; set; } = TimeSpan.FromMinutes(5);
45+
46+
/// <summary>
47+
/// A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background. (>= iOS 11). Default: false
48+
/// </summary>
49+
public bool ShowsBackgroundLocationIndicator { get; set; } = false;
50+
4551
}
4652
}

src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ public async Task<bool> StartListeningAsync(TimeSpan minimumTime, double minimum
401401

402402
// set background flag
403403
#if __IOS__
404+
if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
405+
manager.ShowsBackgroundLocationIndicator = listenerSettings.ShowsBackgroundLocationIndicator;
406+
404407
if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
405408
manager.AllowsBackgroundLocationUpdates = listenerSettings.AllowBackgroundUpdates;
406409

0 commit comments

Comments
 (0)