17 Mar 2013 11:10 PM #1
Unanswered: Sencha Touch Auto sync data to Server
i have built a simple datadriven sencha app with auto sync support to a server api.
i have build the auto sync using Delayed Task that keeps running every x minutes.
As long as the app is running in the foreground the auto sync works fine. But once the app moves into background on Ipad, the auto sync stops.
Can anyone point me in the right direction?
18 Mar 2013 3:28 AM #2
AFAIK, you can't run a JS app in the background unless you wrap it (e.g. Cordova/PhoneGap) and use a bit of native code. If you use Cordova, this bit of code will prevent your app from sleeping while in background:
[UIApplication sharedApplication].idleTimerDisabled = YES;
1 Apr 2013 2:05 AM #3
Thank you for the response, i apologize for reverting back so late.
i tried your idea, but i think it's just not letting the ipad 'sleep' when the app is running.
my requirement here is that when the app itself goes into the background, as in the user switches over to check his email or some other app on his Ipad. and the app should still be running in the background.
i am running a repetitive delayed task to fire some ajax calls to sync data online to the servers.
the task works fine till the app is in foreground, but once the user switches to the home screen or some other app, the sync stops.
any ideas are appreciated. thank you .