I've seen that there's a lot of entries in the forum about Apple's Reachability Class, but I haven't seen a solution for this one.
I'm developing a VoIP app that needs to detect connectivity changes in background mode and real time. SCNetworkReachability API should do the job, but I'm facing some problems...
First of all, I've downloaded Reachability sample code from Apple (v2.2) but I haven't been able to make it work in background mode. It works great if I launch the app on the simulator and plug/unplug de network cable. But if I try on the device, launching the app and then going to background mode for enable/disable wifi, the app isn't been notified at all.
I've set "Application does not run in background = NO" and "Required background modes=App provides Voice over IP services" in the info.plist without success. The Donoho version of this sample code has the same problem.
Second one... I've integrated the Reachability sample code on the VoIP app that I'm developing (Linphone based) and... the connectivity changes are detected on background mode...!!!
Nevertheless, it doesn't work well always:
- if I launch the app with wifi on, all the following reachability changes, even in background mode, are detected -> OK
- but if I launch the app without wifi off, the app doesn't detect the wifi recovery... -> KO
So, the questions are:
- how can I make Apple Reachability sample works in background mode?
- and... when Reachability class looks to be working on background mode, why it only works really when the first reachability check finds connection available?
I'm running the apps on iPhone4 with iOS 5.1.1 (maybe some problem with iOS version > 5.0...??)
I've checked too the pointed solution on this thread, but last version of Reachability sample is already taking care of that retain/release issues...
Thanks in advance