w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How does one do a "socket.join" using pkyeck's Objective-C socket.IO library?

Create a socketIO object and become its delegate:

SocketIO *socketIO = [[SocketIO alloc] initWithDelegate: self];
socketIO.useSecure = YES;
[socketIO connectToHost: @"socket.io" onPort: 443];

When the socket successfully connects send a join event:

- (void)socketIODidConnect: (SocketIO *)socket
    [_socketIO sendEvent: @"join" withData: @{ @"channel" : @"channelName"

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.