Socket.IO client for iOS. Supports socket.io 2.0+
It's based on a official Swift library from here: SocketIO-Client-Swift
It uses Jetfire Jetfire
###This fork fixes an issue with emitting events with ACK not working properly.
#import <SocketIO-iOS/SocketIO-iOS.h>;
NSURL* url = [[NSURL alloc] initWithString:@"http://localhost:8080"];
SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:url config:@{@"log": @YES];
[socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
NSLog(@"socket connected");
}];
[socket connect];
- Supports socket.io 2.0+
- Supports binary
- Supports Polling and WebSockets
- Supports TLS/SSL
Add these line to your Cartfile
:
github "vascome/vpsocketio" ~> 1.0.5 # Or latest version
Run carthage update --platform ios,macosx
.
Create Podfile
and add pod 'VPSocketIO'
(pod files are case sensetive):
##For this fork:
target 'MyApp' do
pod 'VPSocketIO', :git => 'git://github.com/canpoyrazoglu/VPSocketIO.git'
end
##For the original version:
target 'MyApp' do
pod 'VPSocketIO', '~> 1.0.5' # Or latest version
end
MIT