Public 回调函数 | 函数名 |
---|---|
void | didHummerStateChanged:toState:withReason: |
void | didHummerKicked:withDescription: |
void | didHummerPreviousTokenExpired |
Public 回调函数 | 函数名 |
---|---|
void | didPeerMessageReceived:fromUser: |
- (void)didHummerStateChanged:(HMRState)oldState
toState:(HMRState)newState
withReason:(NSString *)reason;
Hummer SDK 状态变更回调
参数 | 描述 |
---|---|
oldState | 变更前状态,详见 HMRState |
newState | 当前状态 |
reason | 变更理由 |
- (void)didHummerKicked:(NSInteger)code
withDescription:(NSString *)desc;desc;
SDK收到多端登录被踢的回调方法
参数 | 描述 |
---|---|
code | 用户被踢下线的原因 |
desc | 用户被踢下线的具体描述 |
- (void)didHummerPreviousTokenExpired;
token过期失效,SDK给予业务层的回调通知
注意:
- 只有在 SDK 断线重连时token过期才会触发,收到该回调时,请调用 refreshToken 方法刷新Token
- (void)didPeerMessageReceived:(HMRMessage *)message
fromUser:(HMRUserId *)user;
当收到点对点信令消息时,会收到该事件的通知回调
注意:
- 该方法通过调用 sendMessage 发生回调。
参数 | 描述 |
---|---|
message | 收到的信令消息 |
user | 发送者标识 |
- (void)didRoomMessageReceived:(HMRMessage *)message
fromUser:(HMRUserId *)user
inRoom:(HMRRoomId *)roomId;
当有一个用户往房间内发一条信令消息时,房间内所有的成员都会收到该事件的通知回调
注意:
- 该方法通过调用 sendMessage 发生回调。
参数 | 描述 |
---|---|
message | 收到的信令消息 |
user | 发送者标识 |
roomId | 房间标识 |
- (void)didRoomAttributesSet:(HMRRoomId *)roomId
withAttributes:(NSDictionary<NSString *, NSString *> *)attributes
byUser:(HMRUserId *)user;
房间属性设置通知
注意:
- 该方法通过调用 setRoomAttributes 发生回调。
参数 | 描述 |
---|---|
roomId | 房间标识 |
attributes | 对应属性 |
user | 操作者标识 |
- (void)didRoomAttributesAddedOrUpdated:(HMRRoomId *)roomId
withAttributes:(NSDictionary<NSString *, NSString *> *)attributes
byUser:(HMRUserId *)user;
房间属性新增或更新通知
注意:
- 该方法通过调用 addOrUpdateRoomAttributes 发生回调。
参数 | 描述 |
---|---|
roomId | 房间标识 |
attributes | 对应属性 |
user | 操作者标识 |
- (void)didRoomAttributesDeleted:(HMRRoomId *)roomId
withAttributes:(nullable NSDictionary<NSString *, NSString *> *)attributes
byUser:(HMRUserId *)user;
房间属性删除通知
注意:
- 该方法通过调用 deleteRoomAttributes 发生回调。
参数 | 描述 |
---|---|
roomId | 房间标识 |
attributes | 对应属性 |
user | 操作者标识 |
- (void)didRoomAttributesCleared:(HMRRoomId *)roomId
withAttributes:(nullable NSDictionary<NSString *, NSString *> *)attributes
byUser:(HMRUserId *)user;
房间属性清空通知
注意:
- 该方法通过调用 clearRoomAttributes 发生回调。
参数 | 描述 |
---|---|
roomId | 房间标识 |
attributes | 对应属性 |
user | 操作者标识 |
- (void)didRoomMemberJoined:(NSSet<HMRUserId *> *)members
inRoom:(HMRRoomId *)roomId;
成员进入房间通知
注意:
- 该方法通过调用 joinRoom 发生回调。
- 当房间人数超过500人时,将不会有该通知
参数 | 描述 |
---|---|
menbers | 成员标识列表 |
roomId | 房间标识 |
- (void)didRoomMemberLeft:(NSSet<HMRUserId *> *)members
inRoom:(HMRRoomId *)roomId;
成员离开房间通知
注意:
- 该方法通过调用 leaveRoom 发生回调。
- 用户自己主动调用leaveRoom方法离开房间,不一定能收到该通知
- 同房间内其他成员离开房间都能收到该通知
- 当房间人数超过500人时,将不会有该通知
参数 | 描述 |
---|---|
menbers | 成员标识列表 |
roomId | 房间标识 |
- (void)didRoomMemberOffline:(NSSet<HMRRoomId *> *)roomIds;
当前用户断线超时离开房间通知
注意:
- 只有当前用户因本地断线超时离开房间时才会触发该通知
参数 | 描述 |
---|---|
roomIds | 房间标识列表 |
- (void)didRoomMemberCountChanged:(HMRRoomId *)roomId
ofCount:(NSInteger)count;
房间人数变更通知
注意:
参数 | 描述 |
---|---|
roomId | 房间标识 |
count | 房间成员总数 |
- (void)didRoomMemberAttributesSet:(HMRUserId *)member
inRoom:(HMRRoomId *)roomId
withAttributes:(NSDictionary<NSString *, NSString *> *)attributes;
房间成员属性设置回调通知
注意:
- 该方法通过调用 setMemberAttributes 发生回调。
参数 | 描述 |
---|---|
menber | 房间成员标识 |
roomId | 房间标识 |
attributes | 设置的属性 |
- (void)didRoomMemberAttributesAddedOrUpdated:(HMRUserId *)member
inRoom:(HMRRoomId *)roomId
withAttributes:(NSDictionary<NSString *, NSString *> *)attributes;
房间成员属性新增或更新回调通知
注意:
- -该方法通过调用 addOrUpdateMemberAttributes 发生回调。
参数 | 描述 |
---|---|
menber | 房间成员标识 |
roomId | 房间标识 |
attributes | 设置的属性 |
- (void)didRoomMemberAttributesDeleted:(HMRUserId *)member
inRoom:(HMRRoomId *)roomId
withAttributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
房间成员属性删除回调通知
注意:
- 该方法通过调用 deleteMemberAttributes 发生回调。
参数 | 描述 |
---|---|
menber | 房间成员标识 |
roomId | 房间标识 |
attributes | 删除的属性 |
- (void)didRoomMemberAttributesCleared:(HMRUserId *)member
inRoom:(HMRRoomId *)roomId
withAttributes:(nullable NSDictionary<NSString *, NSString *> *)attributes;
房间成员属性清空回调通知
注意:
- 该方法通过调用 clearMemberAttributes 发生回调。
参数 | 描述 |
---|---|
menber | 房间成员标识 |
roomId | 房间标识 |
attributes | 清空的属性 |