AsyncStorage 是永久性的吗? [英] Is AsyncStorage permanent?

查看:63
本文介绍了AsyncStorage 是永久性的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将应用程序的身份验证令牌存储在 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. I am sure that it doesn't have to do with the server.

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.

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?

这篇关于AsyncStorage 是永久性的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆