Which Plugin does this impact: Xamarin.Plugins.Permissions
Bug
Version Number of Plugin: 1.1.7
Device Tested On: Nexus 7 (Android 6) and Oppo R5 (CM 13)
Simulator Tested On:
Expected Behavior
When callingawait CrossPermissions.Current.RequestPermissionsAsync(new[] { Permission.Storage });a system dialog is shown when the user can grant/deny the requested permission
Actual Behavior
No dialog is shown and the status of the requested Permission is PermissionStatus.Unknown
Steps to reproduce the Behavior
Sample code:
private async Task<bool> CheckExternalStoragePermission()
{
var externalStorageStatus = false;
try
{
var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Storage);
if (status != PermissionStatus.Granted)
{
if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Storage))
{
await Mvx.Resolve<IUserDialogs>().AlertAsync(Catalog.GetString("We need permission to store the downloaded files"),
Catalog.GetString("Permission to access storage"));
}
var results = await CrossPermissions.Current.RequestPermissionsAsync(new[] { Permission.Storage });
status = results[Permission.Storage];
}
if (status == PermissionStatus.Granted)
{
externalStorageStatus = true;
}
else if (status != PermissionStatus.Unknown)
{
await Mvx.Resolve<IUserDialogs>().AlertAsync(Catalog.GetString("Cannot continue sharing."), Catalog.GetString("Storage Permission Denied"));
}
}
catch (Exception ex)
{
Debug.WriteLine("Exception while requesting Storage permission: "+ex);
externalStorageStatus = false;
}
return externalStorageStatus;
}
Which Plugin does this impact: Xamarin.Plugins.Permissions
Bug
Version Number of Plugin: 1.1.7 Device Tested On: Nexus 7 (Android 6) and Oppo R5 (CM 13) Simulator Tested On:
Expected Behavior
When calling
await CrossPermissions.Current.RequestPermissionsAsync(new[] { Permission.Storage });
a system dialog is shown when the user can grant/deny the requested permissionActual Behavior
No dialog is shown and the status of the requested Permission is PermissionStatus.Unknown
Steps to reproduce the Behavior
Sample code: