反应本机商店令牌,与网络,android,ios 兼容性

React native store tokens, with web, android, ios compability

我在互联网上搜索了很多,但我无法找到解决方案。假设我有 API。我向那个 API 发送登录请求并取回带有过期日期和所有内容的令牌。然后我想将该令牌存储在设备内,并能够 'call it' 在每个组件上......这不是 AsyncStorage 的问题。我的问题是我需要以下兼容性:web, android, ios.

有没有图书馆可以做到这一点?

是否可以将 AsyncStorage 用于:web、android 和 ios?

感谢每一个解决方案!

很抱歉,如果这是一个愚蠢的问题,但我是新手,对本机反应和一般反应...

PS:我的项目是 expo 管理的

我是从this answer that you can try @callstack/async-storage看到的。 在自述文件中,它声明它是一个 cross-platform 网络和移动设备的异步存储实现

编辑

我看到 React Native Async Storage does support all the platforms including web. Documentation here.