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

RequestPermissionAsync<LocationPermission>() hangs with Xcode 12/iOS 14 #183

Open
NeilN1 opened this issue Sep 24, 2020 · 4 comments
Open

Comments

@NeilN1
Copy link

NeilN1 commented Sep 24, 2020

Bug Information

Version Number of Plugin: 6.0.1
Device Tested On:
Simulator Tested On: iPhone 11 iOS 14.0
Version of VS: Mac 8.7.8b4
Version of Xamarin: 6.18.0.23
Versions of other things you are using:

Steps to reproduce the Behavior

  1. Ask user to access location.
  2. Tap Allow While Using App.

Expected Behavior

Dialog disappears and app execution continues.

Actual Behavior

Dialog disappears but app hangs.

Code snippet

                        var locationPerm = await CrossPermissions.Current.CheckPermissionStatusAsync<LocationPermission>();
                        if (locationPerm != Plugin.Permissions.Abstractions.PermissionStatus.Granted)
                        {
                           //Executes
                            locationPerm = await CrossPermissions.Current.RequestPermissionAsync<LocationPermission>();
                        }

                        // Never executes
                        var cameraPerm = await CrossPermissions.Current.CheckPermissionStatusAsync<CameraPermission>();
                        if (cameraPerm != Plugin.Permissions.Abstractions.PermissionStatus.Granted)
                        {
                            cameraPerm = await CrossPermissions.Current.RequestPermissionAsync<CameraPermission>();
                        }

Screenshots

shot_041

Same code works with xCode 11/iOS 13 and running on iOS 14 but built with xCode 11

Might be related to https://medium.com/better-programming/handling-location-permissions-in-ios-14-2cdd411d3cca

@LittleBoxOfChicken
Copy link

I'm just now getting to the bottom of this. There are a lot of issues regarding iOS14, Xamarin and location permissions right now. Hope these get solved soon.

@AGNeosoft
Copy link

Hi, i don't even get this pop up on ios 14 on a real device but i get the pop up on a simulator

@NeilN1
Copy link
Author

NeilN1 commented Sep 25, 2020

@AGNeosoft Delete the app and make sure it doesn't appear in Settings -> Privacy -> Location Services and then reinstall.

@NeilN1
Copy link
Author

NeilN1 commented Sep 25, 2020

Same issue reported in this thread: xamarin/Essentials#1390 The workaround worked for our app.

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

3 participants