Open jose920405 opened 6 years ago
If you look through the source you can see that the cache image name is as follows:
const url = new URL(source.uri, null, true);
const type = url.pathname.replace(/.*\.(.*)/, '$1');
const cacheKey = SHA1(cacheable) + (type.length < url.pathname.length ? '.' + type : '');
Where cacheKey
is the cached filename. You can then use RNFS.downloadFile()
to download from a source URL and save as cacheKey
.
I'm making some changes to the local on my forked repository, if I get time I'll add a method to download and cache an image without having to display it.
Any function for caching image by code.?