Not working for IOS
pruthvirajkarur opened this issue · 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.
I have the same problem! Did you solve it?
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);
}
})