I have PDF download functionality in my web app. It is working fine with all the browsers and iOS11 but it's not working on safari browser and ios12 on mobile or iod pro. I am getting below error - WebKitBlobResource error 1
export const downloadPDF = (downloadLink, fileName, trackId, productId, historyId) => {
return (dispatch) => {
return request.doGetAuth(downloadLink).then(response => {
let contentType = response.headers.get('content-type');
if (_.includes(contentType, 'application/json')) {
return response.json();
} else {
return response.blob();
}
}).then(blobby => {
if (!blobby.message) {
const blob = new Blob([blobby], {
type: 'application/pdf'
});
if (isIos()) {
if (!isCriOs()) {
// For ios
let url = window.URL.createObjectURL(blob);
dispatch(downloadReadyAction(url, fileName));
} else {
// if chrome
let reader = new FileReader();
reader.onload = function(e) {
dispatch(downloadReadyAction(reader.result, fileName));
}
reader.readAsDataURL(blob);
}
} else {
FileSaver.saveAs(blob, fileName);
}
}
}).catch(err => {
console.log('Problem downloading pdf from server ' + err)
})
}
}