I am currently trying to implement the permission checks, to handle API > 23 on Android 6.0 and beyond.
I have tried testing my code (very simple) to see if it will return PERMISSION_GRANTED or PERMISSION_DENIED, when i toggle the apps Camera permission
It has not worked for both Android 6.0 API 23 and Android 7.1 API 25
Here is my code
//var thisActivity = Forms.Context as MainActivity; --> I tried this too, hoping that maybe I was not passing in the correct context.
Android.Content.PM.Permission permissionCheck = ContextCompat.CheckSelfPermission(Android.App.Application.Context,
if(permissionCheck == Android.Content.PM.Permission.Granted)
//Device.BeginInvokeOnMainThread(() => Xamarin.Forms.Application.Current.MainPage.DisplayAlert("Info", "Permission granted", "Ok"));
//I am going to code in the logic for giving the user the option to enable the permission or accept the stats quo here.
//Device.BeginInvokeOnMainThread(() => Xamarin.Forms.Application.Current.MainPage.DisplayAlert("Info", "Permission denied", "Ok"));