unsubscribe

Removes a listener from a topic so it stops receiving that topic's messages.

Requires a joined meeting. Called before the join completes, or while the meeting is RECONNECTING, it can throw, with onError reporting the same reason as code 3001 (ERROR_ACTION_PERFORMED_BEFORE_MEETING_JOINED) or 3014 (ERROR_MEETING_RECONNECTING); the listener then stays registered, and the call is not replayed for you once the meeting reconnects. A listener that is not subscribed to the topic is ignored.

If the server rejects the unsubscribe, onError fires with code 4089 (PUBSUB_UNSUBSCRIBE_FAILED) carrying the server's reason.

Code Example:


try {
    meeting.pubSub.unsubscribe("CHAT", pubSubMessageListener);
} catch (Exception e) {
    Log.d("VideoSDK", "unsubscribe skipped: " + e.getMessage());
}

Parameters

topic

the topic name to unsubscribe from

listener

the PubSubMessageListener to remove

Throws

if the meeting is not joined or is reconnecting, or the pubsub connection is temporarily down; the listener stays registered — retry after the meeting has joined or finished reconnecting