Search code examples
iphonejailbreakautostart

iPhone app autostart without jailbreak


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?


Solution

  • 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.