I have a problem in react native app I want to add clear cache option in react native app for users to clear app cache when they want to clear basically my app is wallpapers app.
For RN 0.60 and above, I am using yarn add oa-react-native-clear-cache or npm install oa-react-native-clear-cache
usage:
import ClearCache from 'oa-react-native-clear-cache'
ClearCache.getAppCacheSize((value, unit) => {
console.log("cache size", value, unit) // check size
ClearCache.clearAppCache(() => {}) // clear cache
})
You can use react-native-clear-app-cache to do this
install with:
npm install --save react-native-clear-app-cache
Link with:
react-native link react-native-clear-app-cache
Use as follow:
import clearCacheModuleObj from '
react-native-clear-app-cache '
[...]
clearCacheModuleObj.clearAppCache()
[...]
Also, i didn't used this module so maybe this doesn't work. Debugging has to be made.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With