How to store tokens in react native?

前端 未结 6 1236
萌比男神i
萌比男神i 2021-02-05 05:59

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?

6条回答
  •  说谎
    说谎 (楼主)
    2021-02-05 06:26

    As an addition to the other answer, you might want to consider encrypting the token on the user device when storing it.

    So in addition to storing it via AsyncStorage you might want to use something like: react-native-keychain to encrypt it on the device.

提交回复
热议问题