1

Is there any way to handle network events on-the-fly in iOS 4.2.1 when app in background?

To be more specific, here are two examples:

  1. Receiving VoIP call while another app in foreground
  2. Receiving XMPP message while another app in foreground

Use of setKeepAliveTimeout:handler: seems not possible, since minimum delay is 600 seconds (10 minutes).

niveuseverto
  • 280
  • 1
  • 3
  • 13

1 Answers1

2

Well you can keep a socket open when you add the Required background modes and add voip to you info.plist. This will allow you to catch any incoming calls, the just notify the user with a UILocalNotification.

You can't really do it for IM system, since they do not fall in the Voip category.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • When I've looked into this for a VoIP+IM client, Apple's position was "once you're voip, you're voip." That is to say that if you are in fact a VoIP client, they are not typically strict about whether you also use that ability to manage XMPP. A pure-IM client, however, needs to use push notifications to receive its messages when in the background. – Rob Napier Aug 30 '11 at 13:30
  • Thanks for your reply, but I in need for more specific reply... on iOS 4.3 my app responds when message is delivered, but on 4.2.1 - it responds only on keep-alive handler... – niveuseverto Aug 30 '11 at 13:34
  • How do apps like Verbs accomplish this behavior? – Chris Ballinger May 10 '12 at 22:41
  • @ChrisBallinger I don't have Verbs, but the way Facebook Messenger and WhatsApp do it by using Push notifications. – rckoenes May 11 '12 at 06:46