unable to get pdf in android
Hello
I have the same issue. I see a white screen.
I see no errors in logs
display /data/data/com.xxx/files/59fd09437da34d1cb322f8f2_59fd0b4c7da34d1cb322fb1a_.pdf 1 12-05 19:30:23.147 14894-14911/com.xxx D/PdfDroid: PdfDocument.nativeOpen(): return handle = 0x5f472e08 12-05 19:30:23.237 14894-14894/com.xxx D/PdfDroid: PdfPage.nativeOpenPage(): return handle = 0x5f7ecd80 12-05 19:30:23.237 14894-14894/com.xxx W/RCTPDFViewAndroid: /data/data/com.xxx/files/59fd09437da34d1cb322f8f2_59fd0b4c7da34d1cb322fb1a_ 1 / 4
Reac Native : 0.43.4
You have to download it first using anohter package. I use react-native-fetch-blob:
const { documentUrl, documentExt } = this.props;
const res = await RNFetchBlob.config({ fileCache:true, appendExt:documentExt }).fetch('GET', documentUrl)
.progress( (received, total) => !this.hasUnmounted && this.setState(() => ({ progress:received/total }) ) );
const filePath = res.path(); // /data/user/0/com.trustedfamily/files/RNFetchBlobTmp_8edhypxhejjzp5os1bqd6s.zip
if (this.hasUnmounted) RNFetchBlob.fs.unlink(filePath);
else this.setState(() => ({ isDownloading:false, filePath, progress:1 }));