// Opens connection to Phoenix
Phoenix *phoenix = [[Phoenix alloc] initWithURL:[NSURL URLWithString:@"ws://10.0.0.12:4000/ws"]];
[phoenix setDelegate:self];
[phoenix open];
// Creates, listens on, and joins channel
PhoenixChannel *channel = [[PhoenixChannel alloc] initWithName:@"channel" topic:@"incoming" message:nil withPhoenix:_phoenix];
[channel on:@"response:event" handleEventBlock:^(id message) {
NSLog(@"Message - %@", message);
}];
[channel join];
To run the example project, clone the repo, and run pod install
from the Example directory first.
SocketRocket - 0.3.1-beta2
Phoenix-ObjC is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Phoenix-ObjC"
Josh Holtz, [email protected]
Phoenix-ObjC is available under the MIT license. See the LICENSE file for more info.