Skip to content

Channel State

A subscribed channel can be one of the following two states: joined or left. A joined channel is active and all messaging listeners/callbacks received published messages. When a channel is in the left state, the subscription is put on hold and no messages arrive to the added listeners/callbacks. When a channel subscription is established, the initial state is joined. The following API provides access to control channel's state:

Leaving Channel

Channel *channel = [Backendless.shared.messaging subscribeWithChannelName:@"MyChannel"];

[channel leave];
let channel = Backendless.shared.messaging.subscribe(channelName: "MyChannel")


Joining Channel

[channel join];

Checking Status

BOOL isJoined = [channel isJoined];
let isJoined = channel.isJoined