Closed SitaMelark closed 1 year ago
Ok so the issue was that react-native-pdf doesnt allow uri, so i just used base64 and now works.
@SitaMelark Could you explain how you did it, I have the same issue. Thanks.
https://developer.android.com/about/versions/11/privacy/storage?hl=en
const ToggleFiles = () => { DocumentPicker.pick({ type: [DocumentPicker.types.pdf], allowMultiSelection:true, copyTo:'cachesDirectory', }).then(res=>{ console.log({res}); console.log(res[0].uri); setFiles(res) }).catch(err=>console.error({err})) }
<Pdf singlePage fitPolicy={0} source={{uri:decodeURIComponent(file.fileCopyUri)}} onError={err=>console.log('FETCHING FILE::ERR ==>',err)} style={{borderRadius:5,flex:1}}/>
React native 0.72.4, react native pdf ^6.7.1 and android platform
When i try show a pdf in the view by using the uri, i get this exception. Seems to be permissions problem but already got external storage permission already.
Join a screenshot or video of the problem on the simulator or device?
This is part of my code: