ashleymills / Reachability.swift

Replacement for Apple's Reachability re-written in Swift with closures
MIT License
7.94k stars 948 forks source link

Reachability doesn't detect reconnection in iOS 10 Simulator #151

Open borneadmin opened 8 years ago

borneadmin commented 8 years ago

Greetings, I'm using Reachability installed using CocoaPods with version:

Might be worth checking out. It's useful for detecting UI changes based on connection status without having to install on a real device.

Thanks for this great library.

bellots commented 8 years ago

Having the same problem.

bellots commented 8 years ago

Have you found the issue?

babac87 commented 8 years ago

Same issue

ashleymills commented 8 years ago

Hi all - apologies for not responding to this issue. If anyone has any time to investigate and raise a PR with a fix that would be much appreciated - or raise a bug with Apple if this looks like an iOS bug.

Cheers Ash

bellots commented 8 years ago

Ok, I’ll check tonight, hoping to find the issue ;)

I’ll fork the repo!

babac87 commented 7 years ago

@bellots have you find out what causes the problem?

bellots commented 7 years ago

@babac87 unfortunately not yet... are you looking for the problem too?

babac87 commented 7 years ago

Haven't look yet. I'll try next week to debug.

ogezue commented 7 years ago

is the reason for this still unknown?

babac87 commented 7 years ago

I believe it's bug only in simulator. On the actual device all works fine.

ogezue commented 7 years ago

Yes I can confirm this - Thank you. I suggest to close this issue and do a remark in the readme.md

ashleymills commented 7 years ago

@ogezue @babac87 Thank you - I'll do that

haifengkao commented 6 years ago

same on ios 11

wyszo commented 6 years ago

I thought this issue affects simulator only. Unfortunately I was also able to replicate this problem on a device. I tried turning flight mode on and off. Tried to do that 30 times. Most of the time it worked as expected. But 3 out of 30 times the connection change was NOT registered by the framework.

wyszo commented 6 years ago

I found that the problem is waaay more prominent when checking host reachability (using init?(hostname: String) convenience initialiser. When we are just checking for internet connection (using init?()) it works much more reliable, even on simulator.

psi-gh commented 6 years ago

Same

yunustek commented 5 years ago

You can use the code for simulator.

var isRunningOnDevice: Bool = {
    #if targetEnvironment(simulator)
    return false
    #else
    return true
    #endif
}()
marcelomogrovejo commented 5 years ago

Same issue here, on simulator and real device. xCode 10.2.1 iOS 12.1 & 12.2

Installed by cocoapods, release version 4.3.1.

Any update to this issue? Thanks.

Gazomba commented 5 years ago

Same issue here, on simulator and real device. xCode 10.2.1 iOS 12.1 & 12.2

Installed by cocoapods, release version 4.3.1.

Any update to this issue? Thanks.

Having exactly the same issue. Only for simulator (running iOS 12.2 on an iPad simulator)

ptejas26 commented 5 years ago

Facing same issue on both device and simulator. Xcode 10.2.1

EvaGonf12 commented 4 years ago

I think this is a problem with simulator because I'm using nwpathmonitor to check connection and I have the same problem. (iOS 13.0 on iphone 11 pro max)

hs-abekert commented 4 years ago

The same here. Checked both the new NWPathMonitor and old SCNetworkReachability.