Da du 3 Berechtigungen haben möchtest, musst du diese auch entsprechend abfragen, siehe weiter unten:
Delphi-Quellcode:
FPermissionCamera := JStringToString(TJManifest_permission.JavaClass.CAMERA);
FPermissionReadStorage := JStringToString(TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE);
FPermissionWriteStorage := JStringToString(TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE);
PermissionsService.RequestPermissions([FPermissionCamera,FPermissionReadStorage,FPermissionWriteStorage],
procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>)
begin
// if (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted) then
if (Length(AGrantResults) = 3)
and (AGrantResults[0] = TPermissionStatus.Granted)
and (AGrantResults[1] = TPermissionStatus.Granted)
and (AGrantResults[2] = TPermissionStatus.Granted) then
TDialogService.ShowMessage('permission granted')
else
begin
TDialogService.ShowMessage('permission not granted');
end;
end
);
end;