Not work on iOS 13.2.3, iPad Mini 4
dzungpv opened this issue · 1 comments
dzungpv commented
I use this library for years for production. Recently I found this bug on iOS 13.2.3, iPad Mini4 connect over wifi.
How to produce the bug: Connect the iPad to the wifi network and then disconnect optical cable (simulate lost internet connection). But it continue to "REACHABLE".
I have not test this on the iPhone.
Code test on Xcode 11.2.1, MacOS 10.14.4:
// Allocate a reachability object
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];
// Set the blocks
reach.reachableBlock = ^(Reachability*reach)
{
// keep in mind this is called on a background thread
// and if you are updating the UI it needs to happen
// on the main thread, like this:
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"REACHABLE!");
});
};
reach.unreachableBlock = ^(Reachability*reach)
{
NSLog(@"UNREACHABLE!");
};
// Start the notifier, which will cause the reachability object to retain itself!
[reach startNotifier];
mantasoff commented
I am still getting the same error. Most of the ping requests return Reachable (iPhone simulator)