ChannelDelegate
@objc public protocol ChannelDelegate: class
The channel delegate protocol defines the event methods available for a channel
-
Called when the Channel is connected
Declaration
Swift
optional func onConnect(client: ChannelClient?, error: NSError?)Parameters
clientThe Client that just connected to the Channel
errorAn error info if any
-
Called when the host app is ready to send or receive messages
Declaration
Swift
optional func onReady() -
Called when the Channel is disconnected
Declaration
Swift
optional func onDisconnect(client: ChannelClient?, error: NSError?)Parameters
clientThe Client that just disconnected from the Channel
errorAn error info if any
-
Called when the Channel receives a text message
Declaration
Swift
optional func onMessage(message: Message)Parameters
messageText message received
-
Called when the Channel receives a binary data message
Declaration
Swift
optional func onData(message: Message, payload: NSData)Parameters
messageText message received
payloadBinary payload data
-
Called when a client connects to the Channel
Declaration
Swift
optional func onClientConnect(client: ChannelClient)Parameters
clientThe Client that just connected to the Channel
-
Called when a client disconnects from the Channel
Declaration
Swift
optional func onClientDisconnect(client: ChannelClient)Parameters
clientThe Client that just disconnected from the Channel
-
Called when a Channel Error is fired
Declaration
Swift
optional func onError(error: NSError)Parameters
errorThe error
ChannelDelegate Protocol Reference