android 交叉权限.当前.CheckPermissionStatusAsync(权限.照相机)已过时

atmip9wb  于 2022-12-02  发布在  Android
关注(0)|答案(1)|浏览(160)
var permissionStatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Plugin.Permissions.Abstractions.Permission.Camera);
if (permissionStatus != Plugin.Permissions.Abstractions.PermissionStatus.Granted)
{
    await CrossPermissions.Current.RequestPermissionsAsync(Plugin.Permissions.Abstractions.Permission.Camera);
}

IPermission.CheckPermissionStatusAsync(权限)已过时:CheckPermissionStatusAsync已过时,请改用CheckPermissionStatusAsync。
我应该如何使用这个方法?

nnvyjq4y

nnvyjq4y1#

旧的

await CrossPermissions.Current.RequestPermissionsAsync(Plugin.Permissions.Abstractions.Permission.Camera);

新建(文档)

await CrossPermissions.Current.RequestPermissionsAsync<CameraPermission>();

相关问题