I have a asset.json file with content, and need to read it within an react-native app. I already figured that it must be manually copied to the native implementation and I can v
I managed finally to copy the content of the static file into the application document directory and read and maintain it there by using NRFechtBlob.fs implementation with provided encoding param like this:
let asset_content = null;
try {
await RNFetchBlob.fs.readFile(assetFile_path, 'utf8')
.then((data) => {
asset_content = data;
console.log("got data: ", data);
})
.catch((e) => {
console.error("got error: ", e);
})
} catch (err) {
console.log('ERROR:', err);
}
const assets = JSON.parse(asset_content);
puh. didn't thought that file handling could be such a pain in 2019.