Skip to content

Commit

Permalink
Add a new parameter in ListenerSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-garcia committed Sep 27, 2019
1 parent 549cadf commit ef24222
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Geolocator.Plugin/Abstractions/ListenerSettings.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,11 @@ public class ListenerSettings
/// </summary>
/// <value>The time between updates (default: 5 minutes).</value>
public TimeSpan? DeferralTime { get; set; } = TimeSpan.FromMinutes(5);

/// <summary>
/// A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background. (>= iOS 11). Default: false
/// </summary>
public bool ShowsBackgroundLocationIndicator { get; set; } = false;

}
}
3 changes: 3 additions & 0 deletions src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ public async Task<bool> 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;

Expand Down

0 comments on commit ef24222

Please sign in to comment.