Building an Android app with Delphi 11.3, I'd like to ask more than one user permission, explaining to the user why he needs to give me this permissions. Using this code in a DataModule:
procedure SetPermissions();
const
Explanation : string = 'you have to...';
begin
TDialogService.MessageDialog(Explanation, TMsgDlgType.mtInformation, [TMsgDlgBtn.mbOK], TMsgDlgBtn.mbOK, 0,
procedure(const AResult: TModalResult)
begin
PermissionsService.RequestPermissions(Permissions,
procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>)
begin
if (Length(AGrantResults) > 0) and (AGrantResults[0] = TPermissionStatus.Granted) then
begin
// permission granted
end
else
begin
// permission not granted
end;
end
);
end
);
end;
It seems clear to me, simple and correct, but the compiler still says:
[DCC Error] udmMain.pas(287): E2250 There is no overloaded version of 'RequestPermissions' that can be called with these arguments
[DCC Error] udmMain.pas(289): E2250 There is no overloaded version of 'MessageDialog' that can be called with these arguments
I can't understand why! Please help me.