cordova-plugin-nativestorage icon indicating copy to clipboard operation
cordova-plugin-nativestorage copied to clipboard

Values not consistent

Open fabianglace opened this issue 6 years ago • 1 comments
trafficstars

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 avatar Mar 09 '19 18:03 fabianglace

@fabianglace did you find a way around this? I think one of my users is experiencing something similar.

CodeWithOz avatar Sep 15 '21 08:09 CodeWithOz