Handling network events on-the-fly while in background in iOS 4.2.1
-
16-01-2021 - |
Question
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:
- Receiving VoIP call while another app in foreground
- Receiving XMPP message while another app in foreground
Use of setKeepAliveTimeout:handler:
seems not possible, since minimum delay is 600 seconds (10 minutes).
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow