Webstorage services Titanium / NG2

I noticed that the Webstorage services doesn’t do anything in Titanium client.
We use it to store the language key of users to show proper login page when they come back.

The following code works in NG1 but not in Titanium / NG2.

function onAction(event) {
	plugins.webstorageLocalstorage.setItem('servoySample', 'some info...');
	
	var itemData = plugins.webstorageLocalstorage.getItem('servoySample');
	plugins.dialogs.showInfoDialog('', itemData);
}

why not use application.set/getUserProperty for that?

application.set/getUserProperty works like a charm in NG1 and Titanium so I will rewrite my code to use these functions.

The only reasons we used the Webstorage service where:

  • Individual keys instead of 1 ‘big’ object
  • clear local storage with 1 function

we could potentially rewrite the impl

that we store it with the key prefixed (i really want that else you can adjust stuff that is not meant to be, or you overwrite a key which is used by something else on the client)
like user.properties.key = value

we could also add a clearUserProperties() if that is really often used. (And then if we would have separate keys we need to really find them)

But currently the plugins webstorage.clear() is really horrible if you ask me, that gives you the power to clear the whole thing, but you have no idea what angular or any of the angular components also maybe would have stored…
So if people think they just clear what they set with that plugin then they really are mistaken…

I have added a feature request for the safe clearing of user properties
https://support.servoy.com/browse/SVY-17384

I have also archived / deprecated the local storage service extension.
It’s functionality is otherwise duplicated by the Application functions and does an unsafe clear()

We will remove it from the package index, but it will still be accessible to download for compatibility reasons from the Git repo binary release.
https://github.com/Servoy/webstorage

Thanks for bringing this to our attention