Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Saving User Settings Permanently - i.e. locally

Is there a way to save users settings within the app?
I've used the settings service in the hope that this would work, but the changes are not reflected once the app restarts.
I need to have a way of storing user selections for when the app opens. I don't want to use the cloud database as I want to keep the app self contained.

regards

Andy

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Saving User Settings Permanently - i.e. locally

Hi Andy!

Use Local Storage to save your settings.

Please take a look here http://docs.tiggzi.com/tutorials/buil...

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Saving User Settings Permanently - i.e. locally

One last question on this topic, as it's working now;

How can I test to see if the local storage variable has been set?

ie, when the app loads I need to read in the "username".
If local storage "username" has not been set yet, I'll get an error.

Is there a test I can perform?

regards

Andy

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Saving User Settings Permanently - i.e. locally

Hi!

Run JavaScript action with the following code:

codeif (localStorage.getItem("var_ls") == 0)
alert ("Error");
else
alert(localStorage.getItem("var_ls"));/code

where var_ls - your local storage variable.

Return to “Issues”