问题
I am writing update checker program in xcode, my program needs background process( it needs to be run in background), so is it possible in phonegap, and is there any phonegap plugin for background services? Thanks
回答1:
iOS does not allow background task to run more than a specific time limit.
Similar Post:
iPhone background task stops running at some point
Explanation:
http://www.macworld.com/article/1164616/how_ios_multitasking_really_works.html
The reasonable solution would be to implement a push notification and send a notification whenever there is an update on server.
回答2:
It is definitely possible to run some JS code in the background to be checking this (https://github.com/jocull/phonegap-backgroundjs).
It won't be possible to do it for more than 10 minutes in the background, though (Run app for more than 10 minutes in background)
So you'll need both a combination of the first plugin I mentioned and the PN service that dhaval is suggesting.
Cheers!
来源:https://stackoverflow.com/questions/11191139/phonegap-background-service-in-ios5