Skip to content

Commit

Permalink
fix: Schedule InitializeIfPermissionIsGranted on the dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
juliecantin committed Sep 18, 2020
1 parent 50aef82 commit 7f29597
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Uno.UWP/Devices/Geolocation/Geolocator.Android.cs
Expand Up @@ -107,7 +107,15 @@ public void WaitForPermissionFromBackground()
CoreApplication.Resuming += CoreApplication_Resuming;
}

private async void CoreApplication_Resuming(object sender, object e)
private void CoreApplication_Resuming(object sender, object e)
{
CoreDispatcher.Main.RunAsync(
priority: CoreDispatcherPriority.Normal,
handler: InitializeIfPermissionIsGranted
);
}

private async void InitializeIfPermissionIsGranted()
{
// If the user has granted the location permission while the app was in background, Initialize
if (await PermissionsHelper.CheckFineLocationPermission(CancellationToken.None))
Expand Down

0 comments on commit 7f29597

Please sign in to comment.