Luki Dwianto
Luki Dwianto

Reputation: 13

Can't get encrypted storage React native

I have React native app that store encrypted storage. But when i wanna get value from Encrypted Storage it return {"_h": 0, "_i": 0, "_j": null, "_k": null}. Is something wrong? i'm using react-native-encrypted-storage

This my code when getting value from Encrypted Storage

export async function getToken() {
  try {
    return await EncryptedStorage.getItem('token');
 
  } catch (error) {

  }
}

Upvotes: 1

Views: 5993

Answers (1)

Woolfy
Woolfy

Reputation: 36

I had a similar problem today with asyncStorage, but solution may apply to your problem.

Try this:

return await EncryptedStorage.getItem('token').then((response) => {return response});

Upvotes: 2

Related Questions