Skip to content

Instantly share code, notes, and snippets.

@trinadhkoya
Created October 3, 2019 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trinadhkoya/d4a655e00a1f05af95a8b11a0a015608 to your computer and use it in GitHub Desktop.
Save trinadhkoya/d4a655e00a1f05af95a8b11a0a015608 to your computer and use it in GitHub Desktop.
const doDownloadPDF = () => async dispatch => {
let filename_attachment = '1';
let ext = '.pdf';
let base64Str = res.base64();
let pdfLocation = DocumentDir + '/' + filename_attachment + ext;
await RNFetchBlob.fs.writeFile(pdfLocation, base64Str, 'base64').then((res) => {
// eslint-disable-next-line no-console
console.log(res)
}, (err) => {
// eslint-disable-next-line no-console
console.log(err)
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment