first run & subsequent run initialization, persistence, and js functions
Hi all,
Excuse my lack of knowledge here. I've made a lot of progress working with appery.io in a short time, but there is a lot I do not understand:
I need to get some idea of the program flow/logic of how an app can be initialized when it is first run/installed, and then on subsequent runs how to determine what needs to be set up. Part of this question has to do with the persistence of local storage, both SQLite and key-value storage variables.
1.) first run/installation - how can I determine whether or not the app is run for the very first time. Normally I would check whether or not a stored value is "first run" or something effectively similar, but I'm not sure how to implement that here. Can I check if a key-value local variable is null, or empty or something?
2.) persistence - when an app is quit, will all of the defaults and settings I want to save in local storage will be there? Are there any conditions under which these are lost? Should I save them to an appery.io cloud database?
3.) There are certain blocks of code I need to call at first-run, subsequent-run, and also as a result of specific user actions. How do I create named javascript functions that can be run/invoked from anywhere? (Ive tried creating a javascript in the project tab on the left, but when I try to call it from another script the console logs flags it as undefined.)
Thanks for your ideas and help!