public async Task DownloadPDF() { dialogService.ShowProgress(); RequestServiceFile request = new RequestServiceFile { Code = ServiceHistorySelected.FileCode, User = loginViewModel.User.UserName }; ResponseServiceFile response = await apiService.GetServiceFile(request); dialogService.HideProgress(); ValidateResponseServiceFile(response); }
private async void ValidateResponseServiceFile(ResponseServiceFile response) { if (await validatorService.ValidateResponse(response) == false) { return; } dialogService.ShowProgress(); byte[] sPDFDecoded = Convert.FromBase64String(response.Value); if (phoneService.IsiOS || (!phoneService.IsiOS && await permissionService.CheckPermissions(Plugin.Permissions.Abstractions.Permission.Storage))) { await phoneService.SaveFiles(AppConfigurations.TitleFileServiceHistory, sPDFDecoded); } dialogService.HideProgress(); }