IPhone reachability

I am trying to cover my bases with availability so the app doesn't get rejected in the App Store. I am familiar with the Reachability class that Apple provides in the sample code. My question is what is the best way to implement this. I've seen that checking WWAN availability isn't always the best because it can be turned off for power consumption. So I have to enable it somehow before testing the connection. Just looking for steps. My application does not require a persistent connection. It does some polls at a given interval, which will require connection and make various other requests. Just trying to figure it out, so I am not rejected. Any help would be great.

Edit: Would the NSURLDomainError error reporting errors be sufficient to make the reports available? It currently displays "No internet connection" and "Can't find host". This seems to be the type of information for which the reachability example is used.

+2


source to share


1 answer


Assuming your application requires an internet connection, you can test connectivity to a website that is always up (like google.com). The reachability pattern code already contains a way to do just that.



I have not worked with the Reachability API to see how it reacts to WWAN system failure to conserve power. The only thing that comes to my mind is trying to establish a network connection so that the system turns on WWAN. Then you can run the reachable code to check which connection you are working with. As said, I haven't tried it, just an idea.

+1


source







All Articles