NIMSignalManager Protocol Reference

Conforms to NSObject
Declared in NIMSignalManagerProtocol.h

Overview

通用音视频信令协议

– signalingCreateChannel:completion: required method

创建频道

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

Parameters

request

创建频道请求

completion

完成回调

Discussion

创建频道

该接口用户创建频道,同一时刻频道名互斥,不能重复创建。但如果频道名缺省,服务器会自动分配频道id。对于频道在创建后如果没人加入,有效期2小时,当有成员加入后会自动延续频道有效期。当主动关闭频道或者最后一个成员退出后2小时后频道销毁。

错误码 200:成功 10405:房间已存在

Declared In

NIMSignalManagerProtocol.h

– signalingCloseChannel:completion: required method

关闭频道

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

Parameters

request

关闭频道请求

completion

完成回调

Discussion

关闭频道

该接口可以由创建者和频道内所有成员调用,无权限限制。调用该接口成功后,其他所有频道内的成员都回收到频道结束的通知,被动离开频道。此时其他成员需要调用离开接口,也不会收到别人的离开通知。

错误码 200:成功 10406:不在房间内

Declared In

NIMSignalManagerProtocol.h

– signalingJoinChannel:completion: required method

加入频道

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

Parameters

request

加入频道请求

completion

完成回调

Discussion

加入频道

错误码 200:成功 10407:已经房间内 10420:已经在房间内(自己的其他端) 10419:房间人数超限 10417:uid冲突

Declared In

NIMSignalManagerProtocol.h

– signalingLeaveChannel:completion: required method

离开频道

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

Parameters

request

离开频道请求

completion

完成回调

Discussion

离开频道

该接口用于自己退出频道,但不对频道进行销毁

错误码 200:成功 10406:不在房间内

Declared In

NIMSignalManagerProtocol.h

– signalingInvite:completion: required method

邀请加入频道

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

Parameters

request

邀请加入频道请求

completion

完成回调

Discussion

邀请加入频道

该接口用于邀请对方加入频道,邀请者必须是创建者或者是频道中成员。如果需要对离线成员邀请,可以打开离线邀请开关并填写推送信息。被邀请者在线后通过离线通知接收到该邀请,并通过房间信息中的invalid_字段判断房间的有效性,也可以对所有离线消息处理后判断该邀请是否被取消。

错误码 200:成功 10404:房间不存在 10406:不在房间内(自己)10407:已经房间内(对方)10419:房间人数超限 10201:对方云信不在线 10202:对方推送不可达

Declared In

NIMSignalManagerProtocol.h

– signalingCancelInvite:completion: required method

取消邀请

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

Parameters

request

取消邀请请求

completion

完成回调

Discussion

取消邀请

错误码 200:成功 10404:房间不存在 10408:邀请不存在或已过期 10409:邀请已经拒绝 10410:邀请已经接受

Declared In

NIMSignalManagerProtocol.h

– signalingReject:completion: required method

拒绝邀请

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

Parameters

request

拒绝邀请请求

completion

完成回调

Discussion

拒绝邀请

拒绝邀请后用户也可以通过加入频道接口加入频道,接口的使用由用户的业务决定

错误码 200:成功 10404:房间不存在 10408:邀请不存在或已过期 10409:邀请已经拒绝 10410:邀请已经接受

Declared In

NIMSignalManagerProtocol.h

– signalingAccept:completion: required method

接受邀请

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

Parameters

request

接受邀请请求

completion

完成回调

Discussion

接受邀请

接受频道接口 不开自动加入开关:该接口只接受邀请并告知邀请者,并同步通知自己的其他在线设备,但不会主动加入频道,需要单独调用加入接口 打开自动加入开关:该接口为组合接口,等同于先调用接受邀请,成功后再加入房间。

错误码 200:成功 10404:房间不存在 10408:邀请不存在或已过期 10409:邀请已经拒绝 10410:邀请已经接受 10407:已经房间内 10420:已经在房间内(自己的其他端) 10419:房间人数超限 10417:uid冲突

Declared In

NIMSignalManagerProtocol.h

– signalingControl:completion: required method

自定义控制指令

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

Parameters

request

自定义控制指令请求

completion

完成回调

Discussion

自定义控制指令

该接口用于在频道中透传一些自定义指令,协助频道管理。该接口允许非频道内成员调用,但接收者必须是频道内成员或创建者

错误码 200:成功 10404:房间不存在 10406:不在房间内(自己或者对方)

Declared In

NIMSignalManagerProtocol.h

– signalingCall:completion: required method

呼叫

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

Parameters

request

呼叫请求

completion

完成回调

Discussion

呼叫

用于用户新开一个频道并邀请对方加入频道,该接口为组合接口,等同于用户先创建频道,成功后加入频道并邀请对方

错误码 200:成功 10405:房间已存在 10201:对方云信不在线 10202:对方推送不可达。该接口是用户呼叫场景的组合接口封装,调用该接口,sdk底层分别会 创建、加入、邀请,再返回用户结果,其中任何一步失败,就返回失败(其中邀请返回10201和10202,认为是成功,返回码还是10201和10202给上层),失败时,sdk需要主动close。常用于但不限于点对点呼叫发起。

error的错误码为10201和10202时,返回的房间信息时有效的,需要用户主动close房间

Declared In

NIMSignalManagerProtocol.h

– signalingQueryChannelInfo:completion: required method

查询频道信息

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

Parameters

request

查询请求

completion

完成回调

Discussion

查询频道信息

Declared In

NIMSignalManagerProtocol.h

– addDelegate: required method

添加通知对象

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

Parameters

delegate

通知对象

Discussion

添加通知对象

Declared In

NIMSignalManagerProtocol.h

– removeDelegate: required method

移除通知对象

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

Parameters

delegate

通知对象

Discussion

移除通知对象

Declared In

NIMSignalManagerProtocol.h