如何在本机反应中存储令牌? [英] How to store tokens in react native?
本文介绍了如何在本机反应中存储令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我以前在 android 中开发,我曾经使用 SharePreference 来存储用户令牌.对于 ios 和 android 来说,react native 中是否有这样的可用内容?
I used to develop in android previously and i used to used SharePreference for storing user tokens. Is there anything such available in react native for both ios and android?
推荐答案
您可能想要使用 异步存储
由于 AsyncStorage
现在已弃用.您可以使用 https://github.com/react-native-community/async-storage
Since AsyncStorage
is deprecated now. You can use https://github.com/react-native-community/async-storage
对于指出 AsyncStorage 不安全的每个人,请参阅此帖子.
For everyone who has pointed out that AsyncStorage is not secure please refer to this post.
这篇关于如何在本机反应中存储令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文