views:

215

answers:

1

Following this question, the same is true for background networking. The documentation is very short-spoken on how to keep a network connection up and running while the application is in the background with the new VoIP API.

The documentation says to add the VoIP string to the info.plist, set your signaling channel to VoIP with

CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);

and the OS will automagically wake up your application from the background when data is coming in on the channel.

However, this is not the case. The application is not woken up if new data arrives on the stream. If I manually wake up the application than the system notifies the app with the last peace of data that arrived while the application was suspended.

Apple states that when you configure a stream for VoIP usage, the system takes over management of the underlying socket while your application is suspended. This handoff to the system is transparent to your application. If new data arrives while your application is suspended, the system wakes up your application so that it can process the data.

So, my question is the same as in the other thread that I have mentioned: What are they doing that I am missing?

A: 

It turns out that the documentation is indeed very short-spoken and the one thing left out is that only the device has this functionality implemented, and the simulator does not.

kadam