1

First of all, I have to say that I am not interested in publishing in the appstore, but at the same time I am not interested in jailbreaking my phone.

I want to experiment with code execution in the background, so I'd like to write a simple application that periodically logs my battery level and my position, let's say every 10 minutes. I don't want to schedule local notifications, so to my understanding, this would only be possible (?) going the 'Pastebot way'.

Can someone please give me more information about that? If I want to test it, will I have to schedule a timer and properly configure my audio session? Or, in other words, I don't understand where my "background executing code" should be placed. Any help/information highly appreciated!

phi
  • 10,634
  • 6
  • 53
  • 88
  • This has been answered at this post: [http://stackoverflow.com/questions/2396786/iphone-app-is-delayed-for-10-15-minutes-when-iphone-is-in-sleep-mode][1] [1]: http://stackoverflow.com/questions/2396786/iphone-app-is-delayed-for-10-15-minutes-when-iphone-is-in-sleep-mode – jakob Aug 16 '11 at 11:00
  • @jakob very nice, I didn't manage to find that through search. Thanks! – phi Aug 18 '11 at 07:22

1 Answers1

0

If you want to use location services, than you can set your application background mode in app info.plist (UIBackgroundModes and add to it location item). And in your application start monitoring location change. Thats it, your application won't be suspended (till system will be in heavy position with memory for other process).

Serhii Mamontov
  • 4,942
  • 22
  • 26
  • Thank you @moonlight, but I'm mostly interested in background execution when playing background audio. – phi Aug 18 '11 at 20:01
  • And thats exactly what I told you in my comment. That flag allows work for applications which require GPS tracking even in when they in background. – Serhii Mamontov Aug 18 '11 at 20:07