Is AsyncStorage permanent?

故事扮演 提交于 2020-01-04 02:11:09

问题


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. I am sure that it doesn't have to do with the server.

Is AsyncStorage permanent?

EDIT: Well, that's embarrassing. The problem was on the server, and it wasn't AsyncStorage's fault.


回答1:


From the RN docs https://facebook.github.io/react-native/docs/asyncstorage.html

On iOS, AsyncStorage is backed by native code that stores small values in a serialized dictionary and larger values in separate files. On Android, AsyncStorage will use either RocksDB or SQLite based on what is available.

Both the databases and the files sound permanent to me. Maybe your users are clearing your app's cache or local files somehow?



来源:https://stackoverflow.com/questions/43273302/is-asyncstorage-permanent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!