Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

await CrossPermissions.Current.RequestPermissionAsync<LocationPermission>() #191

Open
sisaacks opened this issue Feb 9, 2021 · 2 comments

Comments

@sisaacks
Copy link

sisaacks commented Feb 9, 2021

Bug Information

Version with issue: 6.0.1
Last known good version: not known
IDE: Visual Studio For Windows 16.8.4
Platform Target Frameworks:
iOS: Xamarin.iOS 14.0.0.0
Affected Devices: Simulator iPhone 11, iOS 14.0

Steps to reproduce the Behavior

in iOS 14 when permission is accepted and right after the pop-up is closed
await CrossPermissions.Current.RequestPermissionAsync()
never returns, or throws an exception the first time called.

Expected Behavior

in iOS 14 when permission is accepted and right after the pop-up is closed
await CrossPermissions.Current.RequestPermissionAsync()
returns PermissionStatus.Granted.

Actual Behavior

Code snippet

Screenshots

@MartinRValdez
Copy link

Same issue here!

@sisaacks
Copy link
Author

There is an issue in IOS 11. An xamarin fella told me the correct answer is to use essentials. But I did use their workaround to sovle this issue until @jamesmontemagno fixes this.

if (Device.RuntimePlatform == Device.iOS && DeviceInfo.Version.Major >= 14)
{

                        _ = CrossPermissions.Current.RequestPermissionAsync<LocationPermission>();
                        while ((status = await CrossPermissions.Current.CheckPermissionStatusAsync<LocationPermission>()) == PermissionStatus.Unknown)
                        {
                            await Task.Delay(50);
                        }
                    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants