Sails.IO wrapper port for Objective-C so that you can interact with Sails blueprint routes over Sockets and subscribe to changes in your models over Socket.IO (WebSockets).
- Include
#import "SocketIO+SailsIO.h"
- Connect to your Sails server
_socket = [[SocketIO alloc] initWithDelegate:self];
[_socket connectToHost:@"localhost" onPort:1337];
- Make a get request
[_socket get:@"/user" withData:nil callback:^(id response) {
NSLog(@"Records: %@", response);
}];
- Disable authorisation in config/sockets.js in your Sails project, otherwise you won't be able to connect
- All events will come through the usual Socket.IO-objc event delegates
To have a play just check out the FRViewController
** MAKE SURE YOUR SOCKET IS A STRONG POINTER! **
[--] - Turn into CocoaPod
[--] - Move from NSString to NSURL for request URL's... maybe