I'm trying to use react-native-fs in conjunction with react-native-pdf-view. The goal is to bundle my app with a PDF file that can be displayed inside an Android app.
What I can't figure out is how to get a path to that PDF file that's inside the Android package. It's not in the files or caches folder, it's inside the Android package (bundle?) itself.
How can I get a path to that PDF file?
@bomalley Sorry, I'm not very well versed with Android. I'll leave this issue open, so maybe someone else is able to help.
@bomalley See #83 - I've added readDirAssets to list files in the 'assets' folder. You can read the files with readFileAssets.
However, third-party components themselves will need to know how to open a file in the assets folder, as the fairly low-level method of reading asset files is different to that for 'normal' files on disk (e.g. SD Card).
Most helpful comment
@bomalley See #83 - I've added
readDirAssetsto list files in the 'assets' folder. You can read the files withreadFileAssets.However, third-party components themselves will need to know how to open a file in the assets folder, as the fairly low-level method of reading asset files is different to that for 'normal' files on disk (e.g. SD Card).