Andrew Black
Andrew Black

Reputation: 129

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

I have search a lot on internet but I was unable to find solution. Let's say I have API. I send Login request to that API and get back a token with expiraci date and everything. I then want to store that token inside device and be able to 'call it' on every compnent... Thats not a poblem with AsyncStorage. My problem is that I need compability for: web, android, ios.

Is there some library that can do it?

Is it Possible to use AsyncStorage for: web, android and ios?

Thanks for every solution!

Sorry if this is dumb question but I am new to react native and react in general...

PS: My project is expo managed

Upvotes: 0

Views: 290

Answers (1)

Pieter Buys
Pieter Buys

Reputation: 1340

I saw from this answer that you can try @callstack/async-storage. In the readme, it states that it's a cross-platform async storage implementation for web and mobile

Edit

I see that React Native Async Storage does support all the platforms including web. Documentation here.

Upvotes: 2

Related Questions