@llamaluvr thx for your punctualization, bro; I have solved it by downloading the files from Google Drive through Expo FileSystem
attacking the “uc” entry point of Google (https://drive.google.com/uc?id=${link}&export=download
).
Then I open the documents with the package “rn-pdf-reader-js” (https://github.com/wiadev/rn-pdf-reader-js/archive/0.2.6.tar.gz) and everything seems to work fluently ^ _ ^
_openFile = async (title, link, size, extension) => {
const { t, navigation, connection } = this.props;
const fileUrl = `https://drive.google.com/uc?id=${link}&export=download`;
const filePath = `${FileSystem.documentDirectory}library/${link}.${extension}`;
const file = await FileSystem.getInfoAsync(filePath);
if (!connection && !file.exists) {
Toast.show({
type: 'warning',
position: 'top',
text: t('library:unavailableDocument'),
duration: 3000
});
}
else if (file.exists && size == file.size) {
navigation.navigate('DocumentViewer', { title, uri: filePath });
}
else {
this.setState({ downloading: true });
FileSystem.downloadAsync(fileUrl, filePath)
.then(({ uri }) => {
this.setState({ downloading: false });
navigation.navigate('DocumentViewer', { title, uri });
})
.catch((error) => {
this.setState({ downloading: false });
});
}
};
Thx bro…!
Regards,