Skip to content

Channel Subscription

This API subscribes to a channel. Once the channel object is obtained, it can be used to add message listeners/callbacks. Subscription process is not instantaneous, which means an added listener may not receive messages published at the same time when it is added. In order to make sure that the subscriber is ready to receive messages from the channel, it is recommended to check the subscription status.

// subscribe to the "default" channel
Channel *channel = [Backendless.shared.messaging subscribe];

// subscribe to the specific channel
Channel *channel = [Backendless.shared.messaging subscribeWithChannelName:@"Channel Name"];
// subscribe to the "default" channel
let channel = Backendless.shared.messaging.subscribe()

// subscribe to the specific channel
let channel = Backendless.shared.messaging.subscribe(channelName: "Channel name")

Return value

Argument                Description
Channel An object representing the channel subscription. Can be used to add messaging listeners/callbacks.