vasily-popov / VPSocketIO

socket.io client objective-c
MIT License
21 stars 12 forks source link
socket-io socketio socketio-client websocket websocket-client

VPSocketIO

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

Objective-C Example

#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];

Features

Installation

Carthage

Add these line to your Cartfile:

github "vascome/vpsocketio" ~> 1.0.5 # Or latest version

Run carthage update --platform ios,macosx.

CocoaPods 1.0.0 or later

Create Podfile and add pod 'VPSocketIO' (pod files are case sensetive):


target 'MyApp' do
    pod 'VPSocketIO', '~> 1.0.5' # Or latest version
end

License

MIT