react-native-fetch-blob icon indicating copy to clipboard operation
react-native-fetch-blob copied to clipboard

Not working for IOS

Open pruthvirajkarur opened this issue 6 years ago • 2 comments

Hi I am using version 0.10.8. This is working as expected in android. I am able to download the files there. Where as for ios i am not able to download the files. Nothing happens when i click on download button.

Here is the below code i used.

` downloadFinalBlog() { const { config, fs } = RNFetchBlob; let PictureDir = fs.dirs.PictureDir; // this is the pictures directory. You can check the available directories in the wiki. let options = { fileCache: true, addAndroidDownloads: { useDownloadManager: true, // setting it to true will use the device's native download manager and will be shown in the notification bar. notification: false, title: "Great ! Download Success ! :", mime: "application/pdf", description: "Final Blog" } }; config(options) .fetch("GET", this.state.blogdata.blog_file_url)

  .then(res => {
    // do some magic here
    console.log(res);

  }).catch((error) => {

    console.log(error);
  });

}`

Let me know if we have to add some additional code for IOS build.

pruthvirajkarur avatar May 16 '18 10:05 pruthvirajkarur

I have the same problem! Did you solve it?

jacondino avatar Jan 28 '19 13:01 jacondino

For IOS inside your 'then' open the document. Please use below code .then(resp => { // console.log(resp); if (Platform.OS === "ios") { RNFetchBlob.ios.openDocument(resp.data); } })

Pruthvirajcodewave avatar Jan 31 '19 13:01 Pruthvirajcodewave