Closed elrafael closed 4 years ago
Hi, I can't get a key using get method
async doLogin() { const key = 'password'; const value = 'tomato'; SecureStoragePlugin.set({ key, value }).then(val => { console.log(val); }); }
private async getSecure(key) { await SecureStoragePlugin.get({ key }).then(value => { // Do things with value }).catch(error => { console.log('Item with specified key does not exist.'); }); }
Don't know why but I always get the message Item with specified key does not exist. although the method set returns me TRUE.
Can you help me? Rafael
My bad!
I was trying to "Do things with value" using only value.
I need to use
private async getSecure(key) {
await SecureStoragePlugin.get({ key }).then(value => {
// Do things with value
const myKey = value.value // Dear Lord.
}).catch(error => {
console.log('Item with specified key does not exist.');
});
}
The catch was been fired by FirebaseAuth because I'm trying to login using an object not a string
Hi, I can't get a key using get method
Don't know why but I always get the message Item with specified key does not exist. although the method set returns me TRUE.
Can you help me? Rafael