0

We have a cordova/phonegap app which allows users to fill out a survey on a weekly basis. The survey can be filled out regardless of online/offline status. However we would like to send the survey data to the server as soon as possible, which means as soon as the device is online.

Currently the app includes a background process, which sends the data to the server. The problem is that this background process is stopped when the app is terminated.

We would like to know what the options are for making sure that the data is sent to the server regardless of the status of the app (i.e. similar to an email sync service). Are their ways to approach this in platform neutral way, or do we need to investigate native implementations for this?

  • this has a disclaimer re: enterprise use only, but you should be able to see how things can be handled.... https://github.com/katzer/cordova-plugin-background-mode. or, there are some native ways to do a limited background service, or you could implement silent remote notifications to grab send/grab data – gro Nov 20 '15 at 22:04
  • We are actually already using this background module, but as you mention is limited. E.g. if the app is killed, the synchronisation of data is suspended until the app is restarted by the user. Hence my question to overcome that problem. – Axel Hallez Dec 10 '15 at 15:07
  • PushKit may work for you. http://stackoverflow.com/questions/19068762/will-ios-launch-my-app-into-the-background-if-it-was-force-quit-by-the-user – gro Dec 10 '15 at 20:55

0 Answers0