Alex,
Your app will continue to run its javascript code in the background for an unspecified amount of time. If the device decides it needs more memory, it will kill your apps background execution and will stop your app. At that point, your app's javascript will stop executing. Unfortunately you have no guarantee about how long your app will continue to run.
I can't really think of any way to do what you're wanting to do. You could schedule local notifications to fire every so often throughout the day, but that seems like a lot of work and not very efficient.
Zack
On Friday, December 7, 2012 9:11:51 AM UTC-7, Alex wrote:
Hello,
I'm developing a simple app (on IOS, for now) with phonegap which every X seconds has to do something.
If the app is in the foreground there is no problem and everything works fine, but if I push the iphone button it goes in the background and the interval function is not executed any more.
Is it possible to have the javascript code (a timer function) executing in the background with phonegap?
Thanks for any help,
Alex