1

I am developing an iPhone application that communicates with a non iOS device through Wi-Fi. My application is using VOIP.I have configured the streams and added the necessary UIBackgroundModes into my plist .

The problem is that the application is not receiving any information from the external device, When it enters in background.

Could somebody tell me if I am missing something?

User97693321
  • 3,336
  • 7
  • 45
  • 69
rokridi
  • 1,565
  • 2
  • 11
  • 20
  • I think you need to provide a little more detail on what you have tried so far. Maybe post some code? – onnoweb Mar 28 '12 at 14:51
  • 2
    IIRC, network communications is disabled when your IOS apps moves to the background. – KevinDTimm Mar 28 '12 at 14:53
  • I explain more : my app is communicating with an external device via WIFI. When my app moves into background, the OS caches the data coming from the external device then delivers the data when the application returns to the foreground. The problem is that i want to differentiate between data that came in background and data that came in foreground. The question is : should i run a background task to process data coming when app is in the background or should i keep the data processing in the foreground ? – rokridi Mar 28 '12 at 16:35
  • @KevinDTimm : the session is kept alive while the app is in the background. The stream keeps receiving data only when i run a background task. But i do not know if i should process data in background or not(because of the limited time given for a background task) – rokridi Mar 28 '12 at 16:39
  • 1
    @rokridi If your problem is solved, you can answer with detailed explanation and accept your or any answer. – User97693321 Oct 22 '12 at 13:15

2 Answers2

1

Not sure about actual problem.

Make sure following As per iOS background VOIP application it will allow only TCP connection to be alive & communicable in background.

So if you/your stack use UDP socket for VOIP then replace it with TCP.

In case of UDP port remain bind with your application, but it is inactive in background mode & become active in foreground mode.

User97693321
  • 3,336
  • 7
  • 45
  • 69
Divyang Mithaiwala
  • 161
  • 1
  • 1
  • 3
  • I am establishing a TCP connection to communicate with the server (keep in mind that i am developing my application under iOS 5). And i just ran a background task and the application keeps receiving data in background, however this lasts only for maximum 10 minutes. I wonder if i am on the right way. – rokridi Mar 29 '12 at 08:43
  • During this time(Max 10 min) are you sending any packet? Specially time difference between stop receiving & last sent packet? And also differentiate that whatever pkt you recv after coming to foreground is catch pkt or retransmitted. As per SIP standard pkt retransmitted for 32 sec but for TCP it will retransmit pkt for 2 min. – Divyang Mithaiwala Mar 29 '12 at 12:40
  • during this time i am sending and receiving packets – rokridi Mar 29 '12 at 17:40
0

I am assuming that you set the Required background modes in the plist based on your statement correctly. That the array is set the key and the required value for audio and voip. Also do you have the key "application does not run in the background" added to the plist and set to NO.

tman78
  • 1
  • 1