Skip to content

Commit

Permalink
Remove iOS background junk as we dont' need it and only supported in …
Browse files Browse the repository at this point in the history
…event listner.
  • Loading branch information
jamesmontemagno committed Nov 14, 2018
1 parent 7fd207f commit 3e682c1
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Geolocator.Plugin/Apple/GeolocatorImplementation.apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,25 +246,6 @@ public async Task<Position> GetPositionAsync(TimeSpan? timeout, CancellationToke
{
var m = GetManager();
m.DesiredAccuracy = DesiredAccuracy;
#if __IOS__
// permit background updates if background location mode is enabled
if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
{
var backgroundModes = NSBundle.MainBundle.InfoDictionary[(NSString)"UIBackgroundModes"] as NSArray;
var allow = backgroundModes != null && (backgroundModes.Contains((NSString)"Location") || backgroundModes.Contains((NSString)"location"));

if(allow)
{
allow = await CheckPermissions(Permission.LocationAlways);

}
m.AllowsBackgroundLocationUpdates = allow;
}

// always prevent location update pausing since we're only listening for a single update.
if (UIDevice.CurrentDevice.CheckSystemVersion(6, 0))
m.PausesLocationUpdatesAutomatically = false;
#endif

tcs = new TaskCompletionSource<Position>(m);
var singleListener = new GeolocationSingleUpdateDelegate(m, DesiredAccuracy, includeHeading, timeoutMilliseconds, cancelToken.Value);
Expand Down

0 comments on commit 3e682c1

Please sign in to comment.