Thanks for the reply.
The error I’m receiving when attempting to use openURL is
Could not open URL file:///data/user/0/host.expo.exponent/files/ExperienceData/%2540gooddog%252itransfuse/iTransfuseAppCache/BP/RC/rc.pdf: file:///data/user/0/host.expo.exponent/files/ExperienceData/%2540gooddog%252itransfuse/iTransfuseAppCache/BP/RC/rc.pdf exposed beyond app through Intent.getData()
The app is fairly complicated and would take some time to extricate into a simplified snack. I know this doesn’t help much with finding the issue, but perhaps you could give me some pointers based on the overall workflow of the app.
The app pretty much does the following.
- The first time it is loaded, the app creates a number of folders and downloads a bunch of json files and pdfs into
FileSystem.documentDirectory + 'iTransfuseAppCache/BP'. These files are then updated every day when the app is opened (assuming theres an internet connection), essentially caching them.
- When a specific screen is opened, the app uses
NetInfo.isConnected to check connection status and either collects data from the API if the device has internet, or collects it from the json files downloaded earlier.
- On this page is a “View PDF” button. If the device has internet, when it is pressed, it loads the URL to a PDF (obtained from the API) into a WebView. If the devise does NOT have internet, it uses
Linking.openURL to link to one the pdf that was downloaded. The URL for this cached file is something like
Is this possible? Or are files downloaded to the
FileSystem.documentDirectory folder completely inaccessible outside the app. If this is the case, is there a way to download these files to more accessible locations.
Thanks very much