iOS4上的Phonegap后台服务?

发布于 2024-09-25 22:11:57 字数 103 浏览 0 评论 0原文

我可以让在 iOS 4 上运行的 PhoneGap 应用程序在不是活动应用程序时提供后台服务吗(例如,每小时检查一次 URL,并提醒用户是否有任何更改)?

如果是这样,怎么办?

Can I get a phonegap application running on iOS 4 to have a background service when it's not the active app (e.g. check a url every hour and alert the user if there have been any changes)?

And if so, how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

木森分化 2024-10-02 22:11:57

是的,你可以这样做,但苹果可能会不允许这样做。后台运行必须遵守非常具体的规则。对于此类内容,苹果发明了推送通知(来自服务器)。

您可以阅读相关的开发人员文档。

Yes, you can do that, but Apple will probably disallow it. Background running is bound to VERY specific rules. For this kind of stuff Apple invented Push Notifications (from server).

You can read the developer documentation about that.

十二 2024-10-02 22:11:57

实现这一目标的最佳方法是为 PhoneGap 创建一个插件,该插件在手机上本机运行。 PhoneGap 建议任何繁重的工作都由本机代码完成。

查看 IOS 后台任务文档,它应该告诉你什么是允许的,什么是不允许的。

http://developer.apple.com/库/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

The best way to achieve this would be to create a plugin for PhoneGap, which runs natively on the phone. PhoneGap recommends that any heavy lifting be done by native code.

Check out the IOS documentation for background tasks, it should tell you what is allowed, and what is not.

http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

浅笑轻吟梦一曲 2024-10-02 22:11:57

为什么不使用 onPause 和 onResume 事件。他们非常有帮助。

Why don't you use onPause and onResume events. They are quite helpful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文