I saw that the forum has a lot of articles about the Apple Reachability Class, but I have not seen a solution for this.
I am developing a VoIP application that should detect connection changes in the background and in real time. The SCNetworkReachability API should do the job, but I have to face some problems ...
First of all, I downloaded the Reachability sample code from Apple (v2.2), but I was not able to get it to work in the background. It works great if I run the application on the simulator and plug in / unplug the network cable. But if I try on the device by launching the application, and then going into the background to enable / disable Wi-Fi, the application will not be notified at all.
I installed "The application does not start in the background = NO" and "Required background modes = The application provides voice over IP services" in the info file without success. Donoho's version of this test code has the same problem.
Secondly ... I included the Reachability code example in the VoIP application that I am developing (Linphone based), and ... connection changes are detected in the background ... !!!
However, it does not always work:
- If I run the application with Wi-Fi, all of the following reachability changes, even in the background, will be detected → OK
- but if I run the application without Wi-Fi, the application will not detect Wi-Fi recovery ... → KO
So the questions are:
- How can I make an Apple Reachability sample in the background?
- and ... when the Reachability class is running in the background, why does it only work when the first availability check detects that a connection is available?
I run applications on iPhone4 with iOS 5.1.1 (maybe some problems with iOS version> 5.0 ... ??)
I checked the solution too sharp on this topic , but the latest version of the Reachability sample already takes care of these save / release issues ...
Thank you in advance
source share