Just wanted to let you know that I have faced a major issue while using Encrypted storage along with Firebase fcm token for push notifications. So the scenario is I am clearing my whole encrypted storage with EncryptedStorage.clear() after log out in my application so due to that it is deleting my FCM token as well after which I am not able to receive notification specific to that token.
For this the solution will be to use a for loop for all your encrypted storage keys while clearing the storage instead of using EncryptedStorage.clear() which will clear whole app data including your fcm token.
Solution code :
created an object for all your keys you are using for encrypted storage and then remove them after log out like this :
for (let key in LOCALSTORAGE_DATA_KEY_OBJECT) {
EncryptedStorage.removeItem(LOCALSTORAGE_DATA_KEY_OBJECT[key])
}
Hi guys,
Just wanted to let you know that I have faced a major issue while using Encrypted storage along with Firebase fcm token for push notifications. So the scenario is I am clearing my whole encrypted storage with
EncryptedStorage.clear()
after log out in my application so due to that it is deleting my FCM token as well after which I am not able to receive notification specific to that token.For this the solution will be to use a for loop for all your encrypted storage keys while clearing the storage instead of using
EncryptedStorage.clear()
which will clear whole app data including your fcm token.Solution code : created an object for all your keys you are using for encrypted storage and then remove them after log out like this :
Hope this solution helps everyone out there.