Question : OS4 MultiTask Programming: How to get network while in Background?

Hi,
I am very new to OS 4.
I am using Xcode 3.2 and I am working on a chatting system using xmpp.
I want to get the network data even when my app is in the background,
so that any people contact the user, the user will know it.

Right now, if my app is in the background,
it won't get any data from the server.

How can I implement this feature?
Any hint or link?
Or what keyword can I use to search?

thanks

Answer : OS4 MultiTask Programming: How to get network while in Background?

I see only generic articles about iOS 4 SDK. :( Like that:
iPhone OS 4.0: Multitasking and App Switching
http://theappleblog.com/2010/04/08/iphone-os-4-0-multitasking-and-app-switching/

Multitasking on Apple's iPhone 4: How Does It Work?
http://www.pcworld.com/article/198296/multitasking_on_apples_iphone_4_how_does_it_work.html

I think, it makes sense to begin from it:
Understanding iOS 4 Backgrounding and Delegate Messaging
http://www.drobnik.com/touch/2010/07/understanding-ios-4-backgrounding-and-delegate-messaging/

Here is a sample (I've not opened yet):
http://blog.stormyprods.com/2010/06/radiokit-sdk-demo-project-now-includes.html

More about the subject:
http://blog.rlove.org/2010/04/iphone-os-4-and-multitasking.html
http://maniacdev.com/2010/07/screw-multi-tasking-how-to-make-your-ios-4-apps-exit-for-real/

How I understand the story, now the application can be in two modes, the new one is a so called `"suspended". Some services used in the application are multithreaded (location, audio, voip).  If my app is known as the "multi-threaded" and uses one of this services it will receive the notifications.

So, I think, it is not a real multi-tasking.
iPhone multitasking
http://furbo.org/2010/06/21/iphone-multitasking/

I can be absolutely wrong, I've not worked with the multi-tasking for iOS4.
I did hear and see that AVAudioPlayer plays a song when it is in the background (I'm closer to the sound area).

If you work with it, check iOS Reference Library.
UIApplicationExitsOnSuspend
UIBackgroundModes
http://developer.apple.com/iphone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW23

(I do not see anything about an opening URl there, for example).

You will need to these UIBackgroundModes to the .plist file.
<key>UIBackgroundModes</key>
    <array>
            <string>audio</string>
    </array>
Random Solutions  
 
programming4us programming4us