I have client server say "http://abc.com" and i want to check whether this server responding or not.
How to check this with Reachability code from apple?
As i see that code but not able to get where to write my client's url to check this.
Please suggest me.
When you use iPhone with one hand in Portrait orientation, you can use Reachability to lower the top half of the screen so it's within easy reach of your thumb. (Not supported on iPhone SE (1st generation).) Go to Settings > Accessibility > Touch, then turn on Reachability.
Notification On Reachability. Through this service you will be notified if you try to call any number and was unreachable or switched off by receiving an SMS indicates that the number become available now.
swift. Reachability. swift is a replacement for Apple's Reachability sample, re-written in Swift with closures. It is compatible with iOS (8.0 - 12.0), OSX (10.9 - 10.14) and tvOS (9.0 - 12.0)
Here's a synchronous example. You'll probably want to do this asynchronously, but this will get you through for a quick check.
Reachability *netReach = [Reachability reachabilityWithHostName:@"host.name"];
//return [netReach currentReachabilityStatus];
NetworkStatus netStatus = [netReach currentReachabilityStatus];
if (netStatus==ReachableViaWiFi) {
[ViewManager showStatus:@"Reachable (WiFi)!"];
} else if(netStatus==ReachableViaWWAN) {
[ViewManager showStatus:@"Reachable (WWAN)!"];
} else {
[ViewManager showStatus:@"Not reachable, aww :-("];
}
When using reachabilityWithHostName you have to remember that this is just the host name, there should be no http:// prefix or the like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With