Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[Bug] System Location Permission popup is not showing up on android 11 using permission.RequestAsync() #1706

Open
rohanmpalan opened this issue Feb 27, 2021 · 3 comments
Labels
bug Something isn't working need-more-information Need more information to investigate a bug or proposal

Comments

@rohanmpalan
Copy link

The

Steps to Reproduce

public static async Task<bool> CheckPermissionLocation<T>(T permission) where T : BasePermission
       {

           var status = await CheckAndRequestPermissionAsync(permission);

           if (status == Xamarin.Essentials.PermissionStatus.Granted)
               return true;

           return false;
       }
       public static async Task<Xamarin.Essentials.PermissionStatus> CheckAndRequestPermissionAsync<T>(T permission)
             where T : BasePermission
       {

           var status = await permission.CheckStatusAsync();

           if (status == Xamarin.Essentials.PermissionStatus.Granted)
               return status;

           if (status == Xamarin.Essentials.PermissionStatus.Denied)
           {
               // Prompt the user to turn on in settings
               // On iOS once a permission has been denied it may not be requested again from the application
               if (DeviceInfo.Platform == DevicePlatform.Android)
               {
                   status = await permission.RequestAsync();

                   if (status == Xamarin.Essentials.PermissionStatus.Granted)
                       return status;
               }
           }
           status = await permission.RequestAsync();

           return status;
       }

System Permission popup should open and ask to allow location permission.

Actual Behavior No popup pops asking permission

Basic Information

  • Version with issue: 1.6.1
  • Last known good version: NA
  • IDE: VS 19/ VS for Mac
  • Platform Target Frameworks:
    • Android: 11
  • Nuget Packages:
  • Affected Devices: Android 11 devices
@rohanmpalan rohanmpalan added the bug Something isn't working label Feb 27, 2021
@jamesmontemagno
Copy link
Collaborator

Can you please provide a reproduction project? The permission code today works as is.

@jamesmontemagno jamesmontemagno added the need-more-information Need more information to investigate a bug or proposal label Apr 13, 2021
@amsterdammarketing
Copy link

amsterdammarketing commented May 11, 2021

I can confirm this bug with camera permission. Due to client restrictions I can't share my project (sorry about that), but you can check the GitHub repository from JimmyPun610/BarcodeScanner.XF on android 11. This works on iOS... Workaround: Have to set permissions manually. Using Version 1.6.1 and forms 5.0.0.1932.

@jamesmontemagno
Copy link
Collaborator

Please double check for location -> #1580 (comment) as this is working for me.

Ensure you have the proper setup for your android project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working need-more-information Need more information to investigate a bug or proposal
Projects
None yet
Development

No branches or pull requests

3 participants