Hi, I'm wondering how the state of a screen can be saved so that when a user next opens the app they will be directed to the last screen they were on and any data changed on that screen as they last viewed it?
Hi, I'm wondering how the state of a screen can be saved so that when a user next opens the app they will be directed to the last screen they were on and any data changed on that screen as they last viewed it?
You can save data in Local Storage or save data in mobile back-end such as Parse.com. Either way, when the last screen is loaded, you would read the values and display them on the screen Hope this helps..
Thanks Max,
In this case I'd like a user to set the visibility of an image by clicking it.
To save this state do I then add an action to the click event that saves a local storage variable - in this case imagex 'visible'. Then on page load add an event that retrieves the local storage variable imagex 'visible' ?
Just wondering if I can test this in the web browser or whether I would need to move it to the mobile environment? I ask because I tried the above and was unable to see the result in web browser. - Although I haven't added any user-specific data that would remember that a particular user had made the particular change - I guess that is where parse.com would come in to create login credentials?
[quote:]
To save this state do I then add an action to the click event that saves a local storage variable - in this case imagex 'visible'. Then on page load add an event that retrieves the local storage variable imagex 'visible' ?
[/quote]
Yes
[quote:]
Just wondering if I can test this in the web browser or whether I would need to move it to the mobile environment?
[/quote]
Yes, you can easily test in any browser.
[quote:]
Although I haven't added any user-specific data that would remember that a particular user had made the particular change - I guess that is where parse.com would come in to create login credentials?
[/quote]
Yes, one option is to use Parse. But maybe you don't have to, if it's one user per browser.
Thanks Max, I'll have a play
Can you clarify how exactly to save a variable or state to "local storage"? Is local storage something that's part of Tiggzi, or is this a jquery capability?
I need to be able to remember the user ID of the person who is using the app, so I can load in the right information from the backend data services.
Thanks!
Hello,
Local storage is a part of Tiggzi, this is for storing variables in your app.
For example, you can use actions to add local storage variable:
I would also recommend you our docs http://docs.tiggzi.com
Oh, ok. So to clarify, if the user leaves the app and comes back a week later, the value of that variable will be preserved? Or does it just save it during the current session?
It will be saved in constant localStorage (this is a usual variable) - it is not RAM.
Although Tiggzi builder provides a way to save data into local storage, actual local storage features is a standard browser feature. In the screen shot I posted, our builder allows saving data using the events wizard. However, you can use use the API directly from anywhere: codelocalStorage.setItem(value, name); localStorage.getItem(name); /code
More information on browser's local storage: https://developer.mozilla.org/en-US/d...