iPhone应用程序自动启动无需越狱
我是 iPhone 应用程序开发新手。只需要我的应用程序执行一些循环工作(如 cron)。这样做可以防止过度消耗电池。
我意识到我可以使用 /System/Library/LaunchDaemons,但我不确定是否可以在不越狱 iPhone 的情况下使用它?
I am new to iPhone apps developing. Just need my app to do some cyclic job (like a cron). Doing this that way prevent from overconsuming battery.
As I realized I could use /System/Library/LaunchDaemons, but I am not sure if I could use it without jailbreaking iPhone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您无法在未越狱的手机上在指定的应用程序区域之外书写,因此您将无法访问该路径。苹果似乎也不鼓励或支持这种服务,因为除了一些极端情况(位置感知、VoIP 等)[当然在非越狱设备上],即使在后台保持活动应用程序也是不可能的。
您可以考虑(根据情况)使用 推送通知,特别是远程推送通知。这些信息从您的服务器发送到苹果服务器,然后苹果服务器每当目标手机在线时通知它。然后,用户可以选择再次进入您的应用程序,该应用程序可以显示/处理数据。这是一种解决许多可能诉诸轮询的情况的方法,例如即时消息场景。当然,这要求它适合您的应用程序配置文件,并且您有一个受您控制的服务器可以处理所需的任务,并且应用程序仅显示一些信息。
As you cannot write outside your designated application area on a non-jailbroken phone, you will not be able to access that path. Neither does Apple seem to encourage or support this kind of service as even keeping an active app in the background is impossible except for a few corner cases (location-aware, voip, ...) [on non-jailbroken devices on course].
You might consider (depending on the case) using Push notifications, specifically remote push notifications. These are issued from your server to apple servers which in turn notify the target phone whenever it is online. The user then has the option to dive into your app again which can display/handle the data. This is a method to resolve many cases where one might resort to polling, e.g. instant message scenarios. Of course this requires that it fits your application profile and that you have a server under your control that can handle the required task and that the app merely displays some information.