Need to write a file(pdf) and store it in device memory. I'm using react-native-fs library.
I want to make users able to read this file using iBooks as well.
These are react-native-fs 's constants
- MainBundlePath (String) The absolute path to the main bundle directory
- CachesDirectoryPath (String) The absolute path to the caches directory
DocumentDirectoryPath (String) The absolute path to the document directory
TemporaryDirectoryPath (String) The absolute path to the temporary directory (iOS only)
this is my download code
RNFS.downloadFile({
fromUrl: fileLink,
toFile: RNFS.MainBundlePath + '/' + fileName
}).promise.then((dwResult) => {
console.log(dwResult.jobId + 'jobid');
return true
}).catch((err) => {
alert(err);
return false
})
}
What do I have to assign toFile so that written file can be seen using iBooks. Note: I'm able to write file app's path using DocumentDirectoryPath.