iOS/iPhone Reachability - How to only check when internet is lost/not reachable using Reachability.m/.h iOS/iPhone Reachability - How to only check when internet is lost/not reachable using Reachability.m/.h objective-c objective-c

iOS/iPhone Reachability - How to only check when internet is lost/not reachable using Reachability.m/.h


Reachability will send a notification when the status has changed, but what you do with that notification is entirely up to you. If you don't want to tell the user that the network is back, you don't have to.

The "name" parameter in the NSNotificationCenter method indicates what notification you are subscribing to. When an object posts a notification, it does so with a particular name.


If you replace the www.hostname.com with just an IP address, it will only alert once instead of multiple times.


I just started playing around with Reachability and hopefully what I discovered is of use to you.

With regards to multiple 'Not Reachable' while reconnecting, could it be linked to this? Here the poster brought up the definition of 'reachable' for a remote host. I'm guessing while reconnecting the package is not able to go through successfully?

Another possibility is in Reachability Readme.txt

IMPORTANT: Reachability must use DNS to resolve the host name before itcan determine the Reachability of that host, and this may take time oncertain network connections. Because of this, the API will returnNotReachable until name resolution has completed. This delay may bevisible in the interface on some networks.

Maybe give it the IP directly and see if it helps?