This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
RNFetchBlob.ios.previewDocument and .epub files #337
Open
Description
It doesn't seem like previewDocument
can open .epub with the default app (I think normally this would be iBooks), is there something that could be done for this? I'm using react-native-fetch-blob
0.10.4
and RN 0.42.3
.
I tried using the optional scheme
param to no avail:
const ios = RNFetchBlob.ios;
const dirs = RNFetchBlob.fs.dirs;
RNFetchBlob
.config({
scheme: 'itms-books',
path: dirs.DocumentDir + '/' + title + '.epub'
})
.fetch('GET', 'https://www.gutenberg.org/ebooks/54563.epub', {
// Headers here
})
.then((res) => {
console.log('The file saved to ', res.path());
ios.previewDocument(res.path()).catch((err) => Alert.alert('Foutmelding', 'Er is geen geschikte E-reader gevonden'));
})
.catch((err) => {
Alert.alert('Foutmelding', 'Het downloaden van het boek is niet gelukt');
})