RealReachability alternatives and similar libraries
Based on the "Networking" category.
Alternatively, view RealReachability alternatives based on common mentions on social networks and blogs.
-
AFNetworking
A delightful networking framework for iOS, macOS, watchOS, and tvOS. -
CocoaAsyncSocket
Asynchronous socket networking library for Mac and iOS -
RestKit
RestKit is a framework for consuming and modeling RESTful web resources on iOS and OS X -
Reachability.swift
Replacement for Apple's Reachability re-written in Swift with closures -
ASIHTTPRequest
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone -
YTKNetwork
YTKNetwork is a high level request util based on AFNetworking. -
swift-protobuf
Plugin and runtime library for using protobuf with Swift -
apollo-ios
📱 A strongly-typed, caching GraphQL client for iOS, written in Swift. -
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊 -
MonkeyKing
MonkeyKing helps you to post messages to Chinese Social Networks. -
SwiftHTTP
Thin wrapper around NSURLSession in swift. Simplifies HTTP requests. -
Siesta
The civilized way to write REST API clients for iOS / macOS -
APIKit
Type-safe networking abstraction layer that associates request type with response type. -
ResponseDetective
Sherlock Holmes of the networking layer. :male_detective: -
NetworkEye
a iOS network debug library, monitor HTTP requests -
Networking
Easy HTTP Networking in Swift a NSURLSession wrapper with image caching support -
XMNetworking
A lightweight but powerful network library with simplified and expressive syntax based on AFNetworking. -
Pitaya
🏇 A Swift HTTP / HTTPS networking library just incidentally execute on machines -
SPTDataLoader
The HTTP library used by the Spotify iOS client -
Reach
A simple class to check for internet connection availability in Swift. -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
TRON
Lightweight network abstraction layer, written on top of Alamofire -
TWRDownloadManager
A modern download manager based on NSURLSession to deal with asynchronous downloading, management and persistence of multiple files. -
Transporter
A tiny library makes uploading and downloading easier -
Malibu
:surfer: Malibu is a networking library built on promises -
Restofire
Restofire is a protocol oriented networking client for Alamofire -
ws ☁️
⚠️ Deprecated - (in favour of Networking) :cloud: Elegantly connect to a JSON api. (Alamofire + Promises + JSON Parsing) -
EVURLCache
a NSURLCache subclass for handling all web requests that use NSURLRequest -
AFNetworking+RetryPolicy
Nice category that adds the ability to set the retry interval, retry count and progressiveness. -
MultiPeer
📱📲 A wrapper for the MultipeerConnectivity framework for automatic offline data transmission between devices -
AFNetworking-Synchronous
Synchronous requests for AFNetworking 1.x, 2.x, and 3.x -
ROADFramework
ROAD – Rapid Objective-C Applications Development
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of RealReachability or a related project?
README
RealReachability
We need to observe the REAL reachability of network for iOS. That's what RealReachability do.
Why RealReachability?
As we know, we already have reachability framework for us to choose. Such as the famous repository Reachability.
BUT we really need a tool for us to get the reachability, not the local connection!
Apple doc tells us something about SCNetworkReachability API: "Note that reachability does not guarantee that the data packet will actually be received by the host."
The called "reachability" we already know can only tell us the local connection status.These tools currently we know are all supported by the SCNetworkReachability API.
Now RealReachability can do this for you~
We introduce ping module for us to check the real network status, together with SCNetworkReachability API. And we use FSM(finite state machine) to control all of the network status to confirm that only status change will be sent to application.
Enjoy it!
Quick Start With Cocoapods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like RealReachability in your projects. You can install it with the following command:
$ gem install cocoapods
Podfile
To integrate RealReachability into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'RealReachability'
Then, run the following command:
$ pod install
Installation with Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
RealReachability in your Cartfile
:
github "dustturtle/RealReachability"
Manual Start
If you'd rather do everything by hand, just add the folder "RealReachability" to your project, then all of the files will be added to your project.
Dependencies
- Xcode 5.0+ for ARC support, automatic synthesis and compatibility libraries. iOS 6.0+.
- The SystemConfiguration Framework should be added to your project.
Usage
Start to notify(we suggest you to start notify in didFinishLaunchingWithOptions):
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GLobalRealReachability startNotifier];
return YES;
}
Add Observer(anywhere you like):
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(networkChanged:)
name:kRealReachabilityChangedNotification
object:nil];
Observer method like below:
- (void)networkChanged:(NSNotification *)notification
{
RealReachability *reachability = (RealReachability *)notification.object;
ReachabilityStatus status = [reachability currentReachabilityStatus];
NSLog(@"currentStatus:%@",@(status));
}
Trigger realtime Reachability like below:
[GLobalRealReachability reachabilityWithBlock:^(ReachabilityStatus status) {
switch (status)
{
case RealStatusNotReachable:
{
// case NotReachable handler
break;
}
case RealStatusViaWiFi:
{
// case WiFi handler
break;
}
case RealStatusViaWWAN:
{
// case WWAN handler
break;
}
default:
break;
}
}];
Query currentStatus
ReachabilityStatus status = [reachability currentReachabilityStatus];
Once the reachabilityWithBlock was called, the "currentReachabilityStatus" will be refreshed synchronously.
Set your own host for Ping (optional)
Note that now we introduced the new feature "doublecheck" to make the status more reliable in 1.2.0!
Please make sure the host you set here is available for pinging. Large, stable website suggested.
This step is optional. If you do not set this, our default host is: www.apple.com.
You may set your own host any time you like. Codes just like below:
GLobalRealReachability.hostForPing = @"www.apple.com";
GLobalRealReachability.hostForCheck = @"www.youOwnHostExample.com";
We suggest you use two hosts: one your own(if you have one available for pinging), one public; Just like the example below.
For more details about the "doublecheck" feature, you can go deep into the codes.
Get current WWAN type (optional)
WWANAccessType accessType = [GLobalRealReachability currentWWANtype];
Current WWAN type might be used to improve your app's user experience(e.g, set different network request timeout interval for different WWAN type).
Check the VPN status of your network
- (BOOL)isVPNOn;
With the help of this method, we have improved our reachability check logic when using VPN.
More:
We can also use PingHelper or LocalConnection alone to make a ping action or just observe the local connection.
Pod usage like blow (we have two pod subspecs):
pod 'RealReachability/Ping'
pod 'RealReachability/Connection'
This is the only API we need to invoke about Ping:
- (void)pingWithBlock:(void (^)(BOOL isSuccess))completion;
More about the ping usage, please see the PingHelper.h or codes in the demo project.
LocalConnection module is very similar with Reachability.
More about its usage, please see the LocalConnection.h or codes in the demo project.
Demo
We already put the demo project in the repository.
License
RealReachability is released under the MIT license. See LICENSE for details.
And finally...
Please use and improve! Patches accepted, or create an issue.
I'd love it if you could send me a note as to which app you're using it with! Thank you!
支持我
老司机技术周报出品的《WWDC 内参》系列,一直是 iOS 开发的精品阅读,几乎涵盖了每年需要了解的所有 iOS 新技术。尤其是今年《WWDC21 内参》的质量比去年有了比较大的提升, 作为作者之一,在这里安利给大家: https://xiaozhuanlan.com/wwdc21?rel=4203097925。目前活动价五折销售,抓紧入手啦。
中文版使用指南
*Note that all licence references and agreements mentioned in the RealReachability README section above
are relevant to that project's source code only.