IPhone: run in the background indefinitely

I am looking for a way to run an iPhone application in the background indefinitely. This application will not use location services or VoIP, but instead will perform a specific task (sorry, but I can’t directly say what the task is). The task can be compared to checking for the presence of a file, and then sleeping for 1 second. For the purpose of this question, the task must be completed forever.

Any help would be greatly appreciated. As far as I can tell from the iPhone documentation, what I'm asking is not possible, so I'm pretty dead end ...

-2
multithreading iphone background multitasking
Aug 09 2018-11-18T00:
source share
6 answers

You are right - if your reason for working in the background is not suitable for one of the categories that Apple has determined (playing audio, voip, etc.), your application will not work endlessly in the background, If the reason why you want make it really attractive, you can talk to Apple about getting them to allow it. However, expect a long battle. A more pragmatic approach would be to look for ways to achieve the same effect as running background code on a server or registering various notifications from the system.

+1
Aug 09 '11 at 3:00 p.m.
source share

This cannot be done with the current SDK. Applications in the background can only use certain services (audio, location, etc.).

0
Aug 09 2018-11-11T00:
source share

It describes multitasking on iOS. http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5

Acceptable types of multitasking are audio , location and voip , so it seems like your task might not be possible on iOS.

0
Aug 09 2018-11-11T00:
source share

This can only be done in a jailbroken environment. If this is not an option for you, the SDK does not currently support long-term background activity without using audio, location or voip for purposes.

0
Aug 09 '11 at 3:00 p.m.
source share

As already mentioned, true background processing will not be possible for your requirements.

However, perhaps you could use a background notification to achieve your goals?

0
Aug 09 2018-11-11T00:
source share

A disappointing question, but still I answer you for simply explaining the logic. Although this is unacceptable in the process of viewing the application store.

while (your condition)

{ NSAutoreleasePool *aPool = [[NSAutoreleasePool alloc ] init];

  // do your desired task here 

[aPool release] }

Call it in applicationDidEnterBackground and see what happens on the tools to get a good background knowledge.

Happy coding!

0
Aug 09 2018-11-11T00:
source share



All Articles