/// <inheritdoc />
        public async Task <PermissionStatus> CheckPermissionsAsync <T>()
            where T : BasePermission, new()
        {
            var result = await EssentialsPermissions.CheckStatusAsync <T>().ConfigureAwait(false);

            return(result.ToPermissionStatus());
        }
 /// <inheritdoc />
 public async Task <PermissionStatus> RequestPermissionsAsync <T>()
     where T : BasePermission, new()
 {
     return(await MainThread.InvokeOnMainThreadAsync(async() =>
     {
         var result = await EssentialsPermissions.RequestAsync <T>().ConfigureAwait(false);
         return result.ToPermissionStatus();
     }));
 }
        /// <inheritdoc />
        public async Task <PermissionStatus> CheckPermissionsAsync <T>()
            where T : BasePermission, new()
        {
            if (typeof(T) == typeof(NotificationsPermission))
            {
                return(await CheckNotificationsPermissionAsync().ConfigureAwait(false));
            }

            var result = await EssentialsPermissions.CheckStatusAsync <T>().ConfigureAwait(false);

            return(result.ToPermissionStatus());
        }
        /// <inheritdoc />
        public async Task <PermissionStatus> RequestPermissionsAsync <T>()
            where T : BasePermission, new()
        {
            return(await MainThread.InvokeOnMainThreadAsync(async() =>
            {
                if (typeof(T) == typeof(NotificationsPermission))
                {
                    return await RequestNotificationPermissionAsync().ConfigureAwait(false);
                }

                var result = await EssentialsPermissions.RequestAsync <T>().ConfigureAwait(false);

                return result.ToPermissionStatus();
            }));
        }
Example #5
0
 public static void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) =>
 Permissions.OnRequestPermissionsResult(requestCode, permissions, grantResults);