Open minh-dai opened 4 years ago
@iqbalfaisal i want to clear all folder cache app not file
Somebody found a solution ??
added RNFS (react-native-fs) for reading all files in the folder.
let dirs = RNFetchBlob.fs.dirs
let folderPath = dirs.CacheDir // cached folder.
await RNFS.readDir(folderPath)
.then((f) => {
return Promise.all(f.map(e => {
if (e.path.indexOf('xxx-video') > -1) { // specify filter
// console.log('to delete paths', `${e.path}`)
RNFetchBlob.fs.unlink(`${e.path}`)
}
}));
})
https://github.com/joltup/rn-fetch-blob#cache-file-management