我在react原生应用程序中有一个问题,我想在react原生应用程序中添加清除缓存选项,以便用户在想要清除基本上我的应用程序是墙纸应用程序时清除应用程序缓存。
发布于 2020-04-24 04:15:06
您可以使用react-native-clear-app-cache来完成此操作
安装时使用:npm install --save react-native-clear-app-cache
链接地址:react-native link react-native-clear-app-cache
使用方法如下:
import clearCacheModuleObj from '
react-native-clear-app-cache '
[...]
clearCacheModuleObj.clearAppCache()
[...]另外,我没有使用这个模块,所以这可能不起作用。必须进行调试。
发布于 2021-03-19 17:12:37
对于RN 0.60和更高版本,我使用yarn add oa-react-native-clear-cache或npm install oa-react-native-clear-cache
用法:
从‘oa-react- ClearCache -clear-cache’导入缓存
ClearCache.getAppCacheSize((value, unit) => {
console.log("cache size", value, unit) // check size
ClearCache.clearAppCache(() => {}) // clear cache
})https://stackoverflow.com/questions/61392542
复制相似问题