File not viewing on IOS
Hey there,
as a test, I ran the code on the readMe for downloading and opening a file. I've used the exact code with the test link. When I open a file on iOS, it doesn't show the file itself!
I'm on an M1 Mac with the simulator running on IOS 14.5.
Thanks, Omar
Hi! unfortunately I couldn't reproduce the issue. I've tried to run the snippet on the same machine and simulator as you did and everything is working as expected.
The issue you're experiencing reminds me #114. I would double check that your code matches the example snippet, paying attention to specifying the correct extension for the file.
Let me know if you have something else you could share.
Hey, thanks for replying! I used the exact method from the readme. here's my code:
<TouchableOpacity onPress={() => {
const url = 'https://github.com/vinzscam/react-native-file-viewer/raw/master/docs/react-native-file-viewer-certificate.pdf';
const localFile = `${RNFS.DocumentDirectoryPath}/temporaryfile.pdf`;
const options = {
fromUrl: url,
toFile: localFile
};
RNFS.downloadFile(options).promise
.then(() => FileViewer.open(localFile))
.then(() => {
// success
})
.catch(error => {
// error
});
}}>
<Text style={{color: colors.primary, paddingLeft: 15, fontSize: 18}}>
Click to view document
</Text>
</TouchableOpacity>
It doesn't show the file for some reason. Thanks, Omar
Hi, have same issue with 100% valid file link. Mac with M1. Simulator - iOS 14.4 (iPhone11)
Same! it only happens on the simulator though (iOS 14.5), on my device the file is correctly downloaded (I used react-native-blob-util) and opened in preview.
Also, on iOS 15.0 simulators the app crashes, while on iOS devices it works alright
i have same issue. Run on IOS physical device iphone 7 ios 14.5 with local file.
Any solution for this? As i am still facing the same.
Any solution for this? As i am still facing the same.
It's wrong url local file. plz remove "file://"
Same problem
we are also facing issue please help
please check the url path is temporary path or not , Because if i'm facing this issue in document picker , Picking some files to view the file Viewer is showing few minutes the issue is document picker given response data in two url one is temporary and another one is permanent url so please check url to pass the fileViewer...
I'm guess this still isn't resolved?
Same problem
How did you work around this problem?
please check the url path is temporary path or not , Because if i'm facing this issue in document picker , Picking some files to view the file Viewer is showing few minutes the issue is document picker given response data in two url one is temporary and another one is permanent url so please check url to pass the fileViewer...
@Earthiings for url "file:///var/mobile/Media/DCIM/106APPLE/IMG_6092.JPG" can not be preview, but copyed file url file:///private/var/mobile/Containers/Data/Application/12E9CDEF-3FB2-449E-8D4E-D1C8E6B98688/tmp/59FBE229-CD71-4646-A8A5-E1584BCD39AE.jpg can be preview