Curious if there is a client side function that will always run every time PhoneGap app is opened? Right now the only two client side functions I use is the onPhoneGapReady which has code to make background refreshes work on iOS and Android and the onRestoreVariablesFromLocalStorage which is where I run code to bring the user past the login screen if they have already logged in.
However, the issue I am running into is the code in the onRestoreVariablesFromLocalStorage seems to only run under the following circumstances:
1) You close the app from the multitasking screen and then re-open it.
2) You open the app after a long enough time and it needs to reload (possibly from memory).
If you close the app and open it within a certain amount of time it seems it just opens right back up and the onRestoreVariablesFromLocalStorage doesn't run but at this moment I would still like to run some code but not sure what client side event fires and don't want to have to try everyone.
Also, one other thing I am curious about with PhoneGap apps pertains to using Local Storage or the File System. I decided to switch from Local Storage to File System but I found what I believe to be some weird behavior involving restoring variable values, particularly that with all my lists set to saving to the File System the variables (ie control values) don't seem to restore and the onRestoreVariablesFromLocalStorage client side function doesn't seem to run even with the property for persisting variables to Local Storage is selected and the property that says to restore them is selected. However, I got this to work again by changing just one of my lists to save to Local Storage rather than to the File System but not sure why that would work since the persisting variables to Local Storage was different than persisting the lists to Local Storage (or at least I thought).
EDIT: It seems the values are staying in the controls but the onRestoreVariablesFromLocalStorage isn't running which is where my code is to bring the user past the login screen if they already logged in. So the issue now would be if I want to have hall my lists saved to the file system then where can I put code for when the app is opened.
However, the issue I am running into is the code in the onRestoreVariablesFromLocalStorage seems to only run under the following circumstances:
1) You close the app from the multitasking screen and then re-open it.
2) You open the app after a long enough time and it needs to reload (possibly from memory).
If you close the app and open it within a certain amount of time it seems it just opens right back up and the onRestoreVariablesFromLocalStorage doesn't run but at this moment I would still like to run some code but not sure what client side event fires and don't want to have to try everyone.
Also, one other thing I am curious about with PhoneGap apps pertains to using Local Storage or the File System. I decided to switch from Local Storage to File System but I found what I believe to be some weird behavior involving restoring variable values, particularly that with all my lists set to saving to the File System the variables (ie control values) don't seem to restore and the onRestoreVariablesFromLocalStorage client side function doesn't seem to run even with the property for persisting variables to Local Storage is selected and the property that says to restore them is selected. However, I got this to work again by changing just one of my lists to save to Local Storage rather than to the File System but not sure why that would work since the persisting variables to Local Storage was different than persisting the lists to Local Storage (or at least I thought).
EDIT: It seems the values are staying in the controls but the onRestoreVariablesFromLocalStorage isn't running which is where my code is to bring the user past the login screen if they already logged in. So the issue now would be if I want to have hall my lists saved to the file system then where can I put code for when the app is opened.