// Opens connection to Phoenix
_phoenix = [[Phoenix alloc] initWithURL:[NSURL URLWithString:@"ws://localhost:4000/ws"]];
[_phoenix setDelegate:self];
[_phoenix open];
// Creates, listens on, and joins channel
_channel = [[PhoenixChannel alloc] initWithTopic:@"channel:incoming" payload: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.4.x
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.