The document discusses doing background tasks on iOS, which is limited to a few options. It can explain that apps can register to receive location updates, play audio, or perform VOIP tasks in the background by setting the appropriate value in the app's Info.plist file. The document provides code samples and demos for receiving location updates and playing audio in the background. Developers are warned that background tasks may drain the user's battery.
4. Get Your Notepads
Ready
Suspending vs. Resuming
Local Notifications
Doing Stuff in the Background
5. Exiting vs. Resume
Since iOS 4, you can keep your app
open on exit
But its really just a freeze and
resume - nothing happens while its
in the background
6. Resume Me
Set the UIApplicationExitsOnSuspend
to NO in your Info.plist
13. Local Notifications
You can schedule local notifications
to prompt the user at a future time
even if your app isnt running
Useful - but remember the user isnt
required to open the app, and your
notification may never appear
15. Ok, Next
So you can do things in the
background, but its limited to 3
things:
Get GPS updates
Play Justin Bieber
Do the VOIP
16. Set Your Plist
Do do one of those 3 lovely things in
the background, set the
UIBackgroundModes in your
Info.plist
Values are: location, audio, voip
17. Location
Get super duper real-time updates or
major changes only
Use CLLocationManager to do the magic
22. Fighting the Man
People have tried tricking the system
by playing an empty sound file.
This works until some other app plays
sound.
GPS Updates take up battery power, so
your users may hate you.
23. Conclusion
Read more at:
http://developer.apple.com/library/ios/
#documentation/iphone/conceptual/
iphoneosprogrammingguide/
BackgroundExecution/
BackgroundExecution.html
Sample Code: https://github.com/
dnstevenson/BackgroundTest
Good Luck!
24. Thanks!
Find me on Twitter @dnstevenson
Buy one of my apps at http://
www.stevensonsoftware.com
Leave me a 5-star review and Ill be
your best friend