views:

921

answers:

1

I am trying to cover my bases with reachability so that my app doesn't get rejected by the App Store. I am familiar with the Reachability class that Apple provides in sample code. My question is, how best to implement this. I've seen that checking if the WWAN is accessible is not always best because it may be turned off for power consumption. So do I have to somehow enable it before checking for a connection. Just looking for steps to take. My app doesn't need a constant connection. It does some polling on a given interval that will require a connection and makes other various requests. Just trying to figure this out so I don't get rejected. Any help would be great.

Edit: Will reporting errors NSURLDomainError errors suffice for reporting reachability? It currently displays No Internet Connection and Can't Find Host. Seems that this is the type of information that the reachability example is used for.

A: 

Assuming that your application needs a connection to the internet, you could check the connectivity to a website that is always up (like e.g. google.com). The reachability sample code already contains a method to do just that.

I have not worked with the Reachability API enough to know how it reacts to the system switching off the WWAN for power saving. The only thing that comes to my mind is that you could try to establish a connection to the network so the system switches the WWAN on. Then you can run your reachability code to check what kind of connection you are working with. As said, I have not tried it, just an idea.

LeonBrussels
Do I have to do anything to activate the WWAN or do I just need to make a request and the iPhone will figure out if it needs to power it on?
Brian
It seems weird to me to start with that the Reachability API does not report the WWAN as on when it is in power save mode. My advice was just a guess. I am afraid you will just have to experiment and see what happens...
LeonBrussels