Skip to content

fishrod-interactive/sails-io.objective-c

Repository files navigation

image

Sails.IO for Objective-C

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).

Dependencies

Usage

  • 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! **

ToDO

[--] - Turn into CocoaPod

[--] - Move from NSString to NSURL for request URL's... maybe

About

Sails.IO Socket.IO Wrapper for Objective-C

Resources

License

Stars

Watchers

Forks

Packages

No packages published