Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set result after cleanup of locationmanager xamarin#1489
On IOS if you like to request LocationAlways you have to request locationWhenInUse first. This means in an average implementation one would have to consecutive call await Permissions.RequestAsync<Permissions.LocationWhenInUse>(); Permissions.RequestAsync<Permissions.LocationAlways>(); Both use the static LocationManager instance. Since RequestAsync<Permissions.LocationWhenInUse>() sets the result of the task completition source before cleaning up its locationManager there is a race condition where RequestAsync<Permission.LocationAlways>() already runs and thus this cleanup disposes the locationManager used by the second call. This will not always be the case but in my test around 50% of the time. Workaround wait 3-10 seconds in between the calls
- Loading branch information