问题描述
我将应用程序的身份验证令牌存储在 AsyncStorage 中.似乎在 Android 和 iOS 上(对这个不太确定),在长时间不活动(约 2 周)后,用户都会被注销.
I am storing my app's auth token in AsyncStorage. It appears that both on Android and iOS (less sure about this one), after long periods of inactivity (~2 weeks), users are logged out.
AsyncStorage 是永久性的吗?
Is AsyncStorage permanent?
嗯,这很尴尬.问题出在服务器上,而不是 AsyncStorage 的错.
Well, that's embarrassing. The problem was on the server, and it wasn't AsyncStorage's fault.
推荐答案
来自 RN 文档 https://facebook.github.io/react-native/docs/asyncstorage.html
在 iOS 上,AsyncStorage 由本机代码支持,该代码将小值存储在序列化字典中,并将较大值存储在单独的文件中.在 Android 上,AsyncStorage 将根据可用内容使用 RocksDB 或 SQLite.
数据库和文件对我来说都是永久的.也许您的用户正在以某种方式清除您应用的缓存或本地文件?
Both the databases and the files sound permanent to me. Maybe your users are clearing your app's cache or local files somehow?
这篇关于AsyncStorage 是永久性的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!