NIMSignalManager Protocol Reference

Conforms to NSObject
Declared in NIMSignalManagerProtocol.h

Overview

Common audio and video signaling protocol

– signalingCreateChannel:completion: required method

Create a channel

- (void)signalingCreateChannel:(NIMSignalingCreateChannelRequest *)request completion:(nullable NIMSignalingCreateChannelBlock)completion

Parameters

request

Request to create a channel

completion

Completion callback

Discussion

Create a channel

This interface allows users to create channels, and the channel names are unique and cannot be created repeatedly. * If a channel uses a default name. The server will automatically assign the channel an ID. If no participants join the channel after it is created, it will remain valid for 2 hours. When a participant joins the channel, the validity period of the channel will be automatically extended. When the channel is closed or 2 hours after the last member quits, the channel is destroyed.

Error code 200: Success. 10405: Room already exists

Declared In

NIMSignalManagerProtocol.h

– signalingCloseChannel:completion: required method

Close a channel

- (void)signalingCloseChannel:(NIMSignalingCloseChannelRequest *)request completion:(nullable NIMSignalingOperationBlock)completion

Parameters

request

Request to close a channel

completion

Completion callback

Discussion

Close a channel

This interface can be called by the creator and all members of the channel without permissions. After calling this interface successfully, all other members in the channel will receive the notification that the channel will be terminated and leave the channel. In this moment, other members need to call the leave interface, and will not receive the leave notification from others.

Error code 200: Success. 10406: does not exist in the room

Declared In

NIMSignalManagerProtocol.h

– signalingJoinChannel:completion: required method

Join a channel

- (void)signalingJoinChannel:(NIMSignalingJoinChannelRequest *)request completion:(nullable NIMSignalingJoinChannelBlock)completion

Parameters

request

Request to join a channel

completion

Completion callback

Discussion

Join a channel

Error code 200: Success. 10407: Already in the room. 10420: Already in the room (other devices). 10419: The number of people in the room exceeds the upper limit. 10417: uid conflict

Declared In

NIMSignalManagerProtocol.h

– signalingLeaveChannel:completion: required method

leave a channel

- (void)signalingLeaveChannel:(NIMSignalingLeaveChannelRequest *)request completion:(nullable NIMSignalingOperationBlock)completion

Parameters

request

Request to leave a channel

completion

Completion callback

Discussion

leave a channel

This interface is used to exit the channel, but does not destroy the channel

Error code 200: Success. 10406: does not exist in the room

Declared In

NIMSignalManagerProtocol.h

– signalingInvite:completion: required method

Invite a user to join a channel

- (void)signalingInvite:(NIMSignalingInviteRequest *)request completion:(nullable NIMSignalingOperationBlock)completion

Parameters

request

Request to invite a user to join a channel

completion

Completion callback

Discussion

Invite a user to join a channel

The interface is used to invite others to join a channel. The inviter must the owner or member of a channel If a channel member wants to invite offline users, enable offline invitation and send an invitation message. The invitee will get notified when logging in The invitee receives the invitation by an offline notification after getting online, and check the validity of the room through the invalid_ field in the room information, and can also evaluate whether the invitation is cancelled after processing all offline messages.

Error codes. 200: success. 10404: room does not exist. 10406: not in the room (current user). 10407: already in the room (peer). 10419: number of members exceeds the upper limit. 10201: Offline users. 10202: unreachable push notification.

Declared In

NIMSignalManagerProtocol.h

– signalingCancelInvite:completion: required method

Cancel an invitation

- (void)signalingCancelInvite:(NIMSignalingCancelInviteRequest *)request completion:(nullable NIMSignalingOperationBlock)completion

Parameters

request

Request to cancel an invitation

completion

Completion callback

Discussion

Cancel an invitation

Error codes 200: Success. 10404: Room does not exist. 10408: Invitation does not exist or has expired. 10409: Invitation declined. 10410: Invitation already accepted.

Declared In

NIMSignalManagerProtocol.h

– signalingReject:completion: required method

Reject an invitation

- (void)signalingReject:(NIMSignalingRejectRequest *)request completion:(nullable NIMSignalingOperationBlock)completion

Parameters

request

Request to decline an invitation

completion

Completion callback

Discussion

Reject an invitation

After rejecting the invitation, the user can also join the channel by calling the join channel interface. The use of the interface is determined by the user’s business

Error codes 200: Success. 10404: Room does not exist. 10408: Invitation does not exist or has expired. 10409: Invitation declined. 10410: Invitation already accepted.

Declared In

NIMSignalManagerProtocol.h

– signalingAccept:completion: required method

Accept an invitation

- (void)signalingAccept:(NIMSignalingAcceptRequest *)request completion:(nullable NIMSignalingAcceptBlock)completion

Parameters

request

Request to accept an invitation

completion

Completion callback

Discussion

Accept an invitation

accepts the inviation to join a channel Automatic join switch disabled: This interface only accepts the invitation and informs the inviter, and synchronously informs other online devices, but does not join the channel, and must call the join interface separately Automatic join switch enabled: This interface is a combined interface, which is equivalent to calling to accept the invitation first, and then joining the room after success.

Error codes 200: Success. 10404: Room does not exist. 10408: Invitation does not exist or has expired. 10409: Invitation declined. 10410: Invitation already accepted. 10407: Already in the room. 10420: Already in the room (other devices). 10419: The number of people in the room exceeds the upper limit. 10417: uid conflict.

Declared In

NIMSignalManagerProtocol.h

– signalingControl:completion: required method

Custom control instructions

- (void)signalingControl:(NIMSignalingControlRequest *)request completion:(nullable NIMSignalingOperationBlock)completion

Parameters

request

Custom control instruction request

completion

Completion callback

Discussion

Custom control instructions

The interface is used to transfer some custom command in pass-through mode. Users that are not the member of a channel can also call the interface but the recipient must be the member or owner of a channel

Error code 200: Success. 10404: Room does not exist. 10406: does not exist in the room (the current user or the peer)

Declared In

NIMSignalManagerProtocol.h

– signalingCall:completion: required method

Call request

- (void)signalingCall:(NIMSignalingCallRequest *)request completion:(nullable NIMSignalingCallBlock)completion

Parameters

request

call request

completion

Completion callback

Discussion

Call request

The interface is used to create a channel and invite a user to join the channel. This is a combined interface that create a channel and invite others to join the channel in one call

Error codes. 200: success. 10405: Room already exists. 10201: Offline users. 10202: unreachable push notification.. This interface is a combined interface. When this interface is called, the lower layer of the SDK will create, join, invite, and return the results. If any step fails, it will return failure (10201 and 10202 codes indicates successful calls and returned to the upper layer), when it fails, the SDK must actively close. Commonly used but not limited to peer-to-peer call initiation.

error If 10201 and 10202 are returned, the returned room information is valid, and the user must close the room

Declared In

NIMSignalManagerProtocol.h

– signalingQueryChannelInfo:completion: required method

Query a channel

- (void)signalingQueryChannelInfo:(NIMSignalingQueryChannelRequest *)request completion:(nullable NIMSignalingQueryChannelBlock)completion

Parameters

request

request to query a channel

completion

Completion callback

Discussion

Query a channel

Declared In

NIMSignalManagerProtocol.h

– addDelegate: required method

Add a notification object

- (void)addDelegate:(id<NIMSignalManagerDelegate>)delegate

Parameters

delegate

notification object

Discussion

Add a notification object

Declared In

NIMSignalManagerProtocol.h

– removeDelegate: required method

Remove the object for notification

- (void)removeDelegate:(id<NIMSignalManagerDelegate>)delegate

Parameters

delegate

notification object

Discussion

Remove the object for notification

Declared In

NIMSignalManagerProtocol.h