question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RNFetchBlob.ios.openDocument and RNFetchBlob.ios.previewDocument not working in release but working fine on debugging.

See original GitHub issue

Using RNFetchBlob.ios.openDocument and RNFetchBlob.ios.previewDocument in ios, Working fine on debugging mode but not working in release. ReactNative: 0.60.5 rn-fetch-blob: 0.12.0

      const fileName = `abcFile.pdf`
      const dirs = RNFetchBlob.fs.dirs
      const path = dirs.DocumentDir+fileName;
  
    RNFetchBlob.fs.writeFile(path, this.state.base64, 'base64') .then((res) => {

     RNFetchBlob.ios.openDocument(path)
     // RNFetchBlob.ios.previewDocument(path)
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:8

github_iconTop GitHub Comments

4reactions
hashkazi00commented, Jan 15, 2022

is someone still facing this issue?

4reactions
edwinx29commented, Feb 23, 2021

Try using RNFetchBlob.ios.openDocument(path) outside the writeFile Function and put them inside timeout to give it chance to refresh the process

setTimeout(() => { RNFetchBlob.fs.writeFile(path, data, 'base64'); RNFetchBlob.ios.previewDocument(path); },2000);

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-fetch-blob IOS API openDocument not working
I was able to resolve the issue , but i don't know why it actually happened in the first place. I used an...
Read more >
Download a pdf with rn-fetch-blob (IOS) : r/reactnative - Reddit
Hello everyone, I have implemented a download pdf from url with react-native and rn-fetch-blob. I the download is working fine for Android.
Read more >
rn-fetch-blob - npm
A module provides upload, download, and files access API. Supports file stream read/write for process large files.. Latest version: 0.12.0, ...
Read more >
Download Files in React Native with RNFetchBlob
Download Files in React Native with RNFetchBlob ... (TLDR; yarn add rn-fetch-blob ). ... Downloads on iOS work a bit differently.
Read more >
react-native-fetch-blob: Versions - Openbase
Fix #266 IOS but which causes app crash when it failed to read the file from ... Add prelink script for compatible to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found