phonegap background service in iOS5

a 夏天 提交于 2020-01-29 21:48:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!