A network reachability library for iOS that checks real internet connectivity
open sourceMITfree
RealReachability2 tells an iOS app whether it can actually reach the internet, not just whether a network is present. It combines Apple's NWPathMonitor with an HTTP HEAD probe and an ICMP ping, in parallel or one at a time, and offers a Swift API with async/await (iOS 13+) and an Objective-C API with notifications (iOS 12+ when integrated from source), with an optional Wi-Fi to cellular fallback probe. It's its maker's rewrite and successor of RealReachability, and installs with Swift Package Manager or from source.
Problems it solves
- know whether my iOS app really has internet access, not just Wi-Fi
- detect captive portals and dead networks before making requests
- replace the legacy RealReachability library in an iOS app
Features
- combines NWPathMonitor, HTTP HEAD and ICMP ping to check real connectivity
- parallel, HTTP-only or ICMP-only probe modes
- Swift API with async/await (iOS 13+)
- Objective-C API with notifications (iOS 12+ from source)
- optional Wi-Fi to cellular fallback probe in the Objective-C API
Alternatives
The same job
These do what RealReachability2 does.
- Reachability Drop-in replacement for Apple's Reachability class, with blocks and GCD
