cordova-plugin-nativestorage
cordova-plugin-nativestorage copied to clipboard
Values not consistent
Using android 8+, cordova 8+.
On first load gets ID from server and save successfully. When i close the app and reopen it ID is there Close the app again and reopen ID not there, error code: 2. Gets the ID from server and saves again. When reopen the app ID is there but when i close and reopen does not have ID. So essentially the data is not persistent. When i close the app or update it looses the data.
code sample
NativeStorage.getItem("user", function(obj){
uid = obj.uid;
}, function(error){
getFromServer()
});
getFromServer(){ //server get code var user = {uid: uid};
NativeStorage.setItem("user", user, function(){}, function(){}); }
Im I doing something wrong?
@fabianglace did you find a way around this? I think one of my users is experiencing something similar.