permissions

文章目录

var
PermissionsService := TPermissionsService.DefaultService;

//异步方法,需要等待权限的处理在TRequestPermissionsResultEvent内处理
 PermissionsService.RequestPermissions(const APermissions: TArray<string>;
  const AOnRequestPermissionsResult: TRequestPermissionsResultEvent; AOnDisplayRationale: TDisplayRationaleEvent  = nil );

PermissionsService.RequestPermissions
    ([''],
    procedure(const APermissions: TArray<string>;
      const AGrantResults: TArray<TPermissionStatus>)
    begin
    	//验证获取权限
    	if (AGrantResults[0] = TPermissionStatus.Granted) then
      	begin
      	end;
    end);

你可能感兴趣的:(delphi)