【发布时间】:2012-06-25 14:22:20
【问题描述】:
我在 xcode 中编写更新检查程序,我的程序需要后台进程(它需要在后台运行),所以在 phonegap 中是否可以,是否有任何用于后台服务的 phonegap 插件?谢谢
【问题讨论】:
标签: iphone ios5 cordova phonegap-plugins
我在 xcode 中编写更新检查程序,我的程序需要后台进程(它需要在后台运行),所以在 phonegap 中是否可以,是否有任何用于后台服务的 phonegap 插件?谢谢
【问题讨论】:
标签: iphone ios5 cordova phonegap-plugins
iOS 不允许后台任务运行超过特定时间限制。
类似的帖子:
iPhone background task stops running at some point
解释:
http://www.macworld.com/article/1164616/how_ios_multitasking_really_works.html
合理的解决方案是实现推送通知,并在服务器有更新时发送通知。
【讨论】:
绝对可以在后台运行一些 JS 代码来检查这个 (https://github.com/jocull/phonegap-backgroundjs)。
不过,在后台运行超过 10 分钟是不可能的 (Run app for more than 10 minutes in background)
因此,您需要结合我提到的第一个插件和 dhaval 建议的 PN 服务。
干杯!
【讨论】: