typedef NS_ENUM(NSInteger, ByteRTSErrorCode)
回调错误码。
SDK 内部遇到不可恢复的错误时,会通过 rtcEngine:onError: 回调通知用户。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTSErrorCodeInvalidToken | -1000 | Token 无效。 进房时使用的 Token 无效或过期失效。需要用户重新获取 Token,并调用 updateToken: 方法更新 Token。 |
| ByteRTSErrorCodeJoinRoom | -1001 | 加入房间错误。 进房时发生未知错误导致加入房间失败。需要用户重新加入房间。 |
| ByteRTSErrorCodeDuplicateLogin | -1004 | 相同用户 ID 的用户加入本房间,当前用户被踢出房间 |
| ByteRTSErrorCodeKickedOut | -1006 | 服务端调用 OpenAPI 将当前用户踢出房间 |
| ByteRTSErrorCodeRoomIdIllegal | -1007 | 当调用 createRtcRoom: ,如果 roomId 非法,会返回 null,并抛出该错误 |
| ByteRTSErrorCodeTokenExpired | -1009 | Token 过期。调用 joinRoomByKey:roomId:userInfo:rtcRoomConfig: 使用新的 Token 重新加入房间。 |
| ByteRTSErrorCodeUpdateTokenWithInvalidToken | -1010 | 调用 updateToken: 传入的 Token 无效 |
| ByteRTSErrorCodeRoomDismiss | -1011 | 服务端调用 OpenAPI 解散房间,所有用户被移出房间。 |
| ByteRTSRoomAlreadyExist | -1013 | 通话回路检测已经存在同样 roomId 的房间了 |
| ByteRTSUserIDDifferent | -1014 | 加入多个房间时使用了不同的 uid。 同一个引擎实例中,用户需使用同一个 uid 加入不同的房间。 |
| ByteRTSErrorCodeAbnormalServerStatus | -1084 | 服务端异常状态导致退出房间。 SDK与信令服务器断开,并不再自动重连,可联系技术支持。 |
typedef NS_ENUM(NSInteger, ByteRTSWarningCode)
回调警告码。
警告码说明 SDK 内部遇到问题正在尝试恢复。警告码仅作通知。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTSWarningCodeJoinRoomFailed | -2001 | 进房失败。 初次进房或者由于网络状况不佳断网重连时,服务器内部错误导致进房失败。此时 SDK 会自动重试进房。 |
| ByteRTSWarningCodePublishStreamFailed | -2002 | 发布音视频流失败。 当你在所在房间中发布音视频流时,由于服务器错误导致发布失败。SDK 会自动重试发布。 |
| ByteRTSWarningCodeSendCustomMessage | -2011 | 发送自定义广播消息失败,当前你未在房间中。 |
| ByteRTSWarningCodeOldRoomBeenReplaced | -2016 | 新生成的房间已经替换了同样roomId的旧房间 |
typedef NS_ENUM(NSInteger, ByteRTCLoginErrorCode)
登录结果
调用 login:uid: 登录的结果,会通过 rtcEngine:onLoginResult:errorCode:elapsed: 回调通知用户。
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCLoginErrorCodeSuccess | 0 | 调用 login:uid: 方法登录成功。 |
| ByteRTCLoginErrorCodeInvalidToken | -1000 | 调用 login:uid: 方法时使用的 Token 无效或过期失效。需要用户重新获取 Token。 |
| ByteRTCLoginErrorCodeLoginFailed | -1001 | 登录错误 调用 login:uid: 方法时发生未知错误导致登录失败。需要用户重新登录。 |
| ByteRTCLoginErrorCodeInvalidUserId | -1002 | 调用 login:uid: 方法时传入的用户 ID 有问题。 |
| ByteRTCLoginErrorCodeServerError | -1003 | 调用 login:uid: 登录时服务器错误。 |
typedef NS_ENUM(NSInteger, ByteRTCUserMessageSendResult)
发送消息结果,成功或失败,及失败原因
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCUserMessageSendResultSuccess | 0 | 发送消息成功 |
| ByteRTCUserMessageSendResultTimeout | 1 | 发送超时,没有发送。 |
| ByteRTCUserMessageSendResultNetworkDisconnected | 2 | 通道断开,没有发送 |
| ByteRTCUserMessageSendResultNoReceiver | 3 | 找不到接收方 |
| ByteRTCUserMessageSendResultNoRelayPath | 4 | 远端用户没有登录或进房 |
| ByteRTCUserMessageSendResultExceedQPS | 5 | 超过 QPS 限制 |
| ByteRTCUserMessageSendResultNotJoin | 100 | 消息发送方没有加入房间 |
| ByteRTCUserMessageSendResultInit | 101 | 连接未完成初始化 |
| ByteRTCUserMessageSendResultNoConnection | 102 | 没有可用的数据传输通道连接 |
| ByteRTCUserMessageSendResultExceedMaxLength | 103 | 消息超过最大长度,当前为64KB |
| ByteRTCUserMessageSendResultEmptyUser | 104 | 接收消息的单个用户 id 为空 |
| ByteRTCUserMessageSendResultNotLogin | 105 | 房间外或应用服务器消息发送方没有登录 |
| ByteRTCUserMessageSendResultServerParamsNotSet | 106 | 发送消息给业务方服务器之前没有设置参数 |
| ByteRTCUserMessageSendResultUnknown | 1000 | 失败,未知错误。 |
typedef NS_ENUM(NSInteger, ByteRTCRoomMessageSendResult)
房间内广播消息发送结果
| 类型 | 值 | 说明 |
|---|---|---|
| ByteRTCRoomMessageSendResultSuccess | 200 | 消息发送成功 |
| ByteRTCRoomMessageSendResultTimeout | 1 | 发送超时,没有发送 |
| ByteRTCRoomMessageSendResultNetworkDisconnected | 2 | 通道断开,没有发送 |
| ByteRTCRoomMessageSendResultExceedQPS | 5 | 超过 QPS 限制 |
| ByteRTCRoomMessageSendResultNotJoin | 100 | 失败,发送方未加入房间 |
| ByteRTCRoomMessageSendResultInit | 101 | 失败,连接未完成初始化。 |
| ByteRTCRoomMessageSendResultNoConnection | 102 | 失败,没有可用的连接。 |
| ByteRTCRoomMessageSendResultExceedMaxLength | 103 | 消息超过最大长度,当前为 64KB |
| ByteRTCRoomMessageSendResultUnknown | 1000 | 失败,未知错误。 |