I am trying to figure out a way to do this without ejecting. I’ve tried using a WebView
<WebView source={{uri: "file:///..."}} />
But nothing displays. Are there permissions issues? Is it an IOS simulator problem? Is it not possible? I’m getting no errors from the system. Please let me know your thoughts, I’ve spent hours researching this with no luck. I’m hoping with your expertise we can figure out the best approach.
Update: This is working for IOS, but not for android. Does anyone know if this is possible for android? I read that Lollipop+ webviews should support PDFs. Is this an android file access problem? Thanks!
It seems file:///data/user/0/host.exp.exponent/files/ExperienceData/%2540jogillesp%252Foo/pdfs/26.pdf
doesn’t actually exist on my Mac. Where is the file being stored, or is it being stored? FileSystem throws no errors, and seems to download fine.
The file exists on your Android device (virtual or physical). There are some tools to inspect the files on Android devices that might let you browse to that path if you have the right permissions. You could also use the FileSystem module to verify the existence of the file (ex: try reading it back). If the WebView won’t display the file and it exists, the error might be related to permissions as suggested above, and you’d have to dive more into Android’s implementation to see what the root cause could be.