Callback | Function Name |
---|---|
void | onHummerLogin |
void | onRefreshToken |
Notification | Function Name |
---|---|
void | onHummerStateChanged |
void | onHummerKicked |
void | onHummerPreviousTokenExpired |
Callback | Function Name |
---|---|
void | onSetRoomAttributes |
void | onAddOrUpdateRoomAttributes |
void | onDeleteRoomAttributes |
void | onClearRoomAttributes |
void | onQueryRoomAttributes |
void | onQueryRoomAttributesByKeys |
void | onQueryMembers |
void | onQueryMemberCounts |
void | onSendMessage |
Notification | Function Name |
---|---|
void | onRoomMessageReceived |
void | onRoomAttributesSet |
void | onRoomAttributesDeleted |
void | onRoomAttributesCleared |
void | onRoomAttributesAddedOrUpdated |
Callback | Function Name |
---|---|
void | onJoinRoom |
void | onLeaveRoom |
void | onSetMemberAttributes |
void | onAddOrUpdateMemberAttributes |
void | onClearMemberAttributes |
void | onDeleteMemberAttributes |
void | onQueryMemberAttributes |
void | onQueryMemberAttributesByKeys |
Notification | Function Name |
---|---|
void | onRoomMemberJoined |
void | onRoomMemberLeft |
void | onRoomMemberOffline |
void | onRoomMemberCountChanged |
void | onRoomMemberAttributesSet |
void | onRoomMemberAttributesDeleted |
void | onRoomMemberAttributesCleared |
void | onRoomMemberAttributesAddedOrUpdated |
Callback | Function Name |
---|---|
void | onSendMessage |
void | onQueryUserOnlineStatus |
Notification | Function Name |
---|---|
void | onPeerMessageReceived |
Callback | Function Name |
---|---|
void | onHummerLogWithLevel |
void onHummerStateChanged(State oldState, State newState, const hmr::String& reason)
Callback of status change of a Hummer SDK.
Parameter | Description |
---|---|
oldState | Previous status |
newState | New status |
reason | Change description |
void onHummerKicked(const Code& kickCode)
Callback of the SDK to remove users when login through multiple ends is detected.
Parameter | Description |
---|---|
kickCode | Error code |
void onHummerPreviousTokenExpired()
Callback notification returned by the SDK to the service layer upon token expiration.
Notes:
- This callback is triggered only when token expires upon the SDK reconnection from disconnection. Once receiving this call, call refreshToken to refresh the token.
void onHummerLogin(RequestId requestId,
UserId userId,
const Code& code)
Callback of the Hummer login result.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
UserId | Operator ID |
code | Error code |
void onRefreshToken(RequestId requestId, const Code& code)
Callback of the refresh result of user token.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Error code |
void onRoomAttributesSet(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Notification of setting room profiles.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Fully set profiles |
void onRoomMessageReceived(const RoomId& roomId,
UserId userId,
const Message& msg)
When you send a signaling message to a room, all members in this room will receive a callback notification of this event.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Sender ID |
msg | Signaling message |
void onRoomAttributesDeleted(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Notification of deleting room profiles.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Fully set profiles |
void onRoomAttributesCleared(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Notification of clearing room profiles.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Corresponding profiles |
void onRoomAttributesAddedOrUpdated(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Notification of updating room information.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Corresponding profiles |
void onSetRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes,
const RoomAttributeOptions& options)
Callback of the result of setting room profiles.
Notes:
- Call setRoomAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
attributes | Corresponding profiles |
options | Configuration information for sent signaling messages |
onAddOrUpdateRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes,
const RoomAttributeOptions& options)
Callback of the result of adding or updating profiles of specific rooms.
Notes:
- Call addOrUpdateRoomAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
attributes | Corresponding profiles |
options | Configuration information for sent signaling messages |
void onDeleteRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const String keys[],
int numberOfKeys,
const RoomAttributeOptions& options)
Callback of the result of deleting room profiles.
Notes:
- Call deleteRoomAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
keys | Profile array |
numberOfKeys | Number of profiles |
options | Configuration information for sent signaling messages |
void onClearRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const RoomAttributeOptions& options)
Callback of the result of clearing all room profiles.
Notes:
- Call clearRoomAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
options | Configuration information for sent signaling messages |
void onQueryRoomAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes)
Callback of the result of searching all room profiles.
Notes:
- Call queryRoomAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
attributes | Fully set profiles |
void onQueryRoomAttributesByKeys(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& attributes)
Callback of the result of searching specific room profiles.
Notes:
- Call queryRoomAttributesByKeys to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
attributes | Fully set profiles |
void onRoomMemberJoined(const RoomId& roomId,
const UserId userIds[],
int numberOfUserIds)
Notification of members joining a room. This notification will not be sent if over 500 members have joined the room.
Parameter | Description |
---|---|
roomId | Room ID |
userIds | User ID array |
numberOfUserIds | Number of user IDs |
void onRoomMemberLeft(const RoomId& roomId,
const UserId userIds[],
int numberOfUserIds)
Notification of members exiting a room. This notification will not be sent if over 500 members have joined the room.
Parameter | Description |
---|---|
roomId | Room ID |
userIds | User ID array |
numberOfUserIds | Number of user IDs |
void onRoomMemberOffline(const RoomId roomIds[], int numberOfRoomIds)
Notification of the current user exiting the room due to disconnection timeout.
Notes:
- This notification is triggered only when the current user exits the room due to local disconnection timeout.
Parameter | Description |
---|---|
userIds | User ID array |
numberOfUserIds | Number of user IDs |
void onRoomMemberCountChanged(const RoomMemberCount memberCounts[], int numberOfCounts)
Notification of number change of room members.
Parameter | Description |
---|---|
memberCounts | Room user array |
numberOfCounts | Number of room members |
void onRoomMemberAttributesSet(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Notification of setting member attributes.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Corresponding profiles |
void onRoomMemberAttributesDeleted(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Notification of deleting member profiles.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Corresponding profiles |
void onRoomMemberAttributesCleared(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Callback notification of clearing room member information.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Corresponding profiles |
void onRoomMemberAttributesAddedOrUpdated(const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Callback notification of updating room member information.
Parameter | Description |
---|---|
roomId | Room ID |
userId | Operator ID |
attributes | Corresponding profiles |
void onJoinRoom(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Dictionary& extras,
const RoomJoinningOptions& options)
Callback of the result of joining a room.
Notes:
- Call joinRoom to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for a room operation result |
roomId | Room ID |
extras | Extension information for joining a room |
options | Optional parameters for joining a room |
void onLeaveRoom(RequestId requestId,
const Code& code,
const RoomId& roomId)
Callback of the result of exiting a room.
Notes:
- Call leaveRoom to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
void onQueryMembers(RequestId requestId,
const Code& code,
const RoomId& roomId,
const UserId userIds[],
int numberOfUserIds)
Callback of the result of searching room members.
Notes:
- Call queryMembers to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for operation result |
roomId | Room ID |
userIds | User ID array |
numberOfUserIds | NUmber of user IDs |
void onQueryMemberCounts(RequestId requestId,
const Code& code,
const RoomMemberCount memberCounts[],
int numberOfCounts)
Callback of the result of searching a list of room members.
Notes:
- Call queryMemberCounts to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for operation result |
memberCounts | Room member number set |
numberOfCounts | Volume of room member number set |
void onSendMessage(RequestId requestId,
const Code& code,
const RoomId& roomId,
const Message& msg,
const MessagingOptions& options)
Callback of the result of sending room messages.
Notes:
- Call sendMessage to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
msg | Message |
options | Message options |
void onSetMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes,
const MemberAttributeOptions& options)
Callback of the result of setting room member profiles.
Notes:
- Call setMemberAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
userId | Sender ID |
attributes | Message |
options | Message options |
void onAddOrUpdateMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes,
const MemberAttributeOptions& options)
Callback of the result of updating room member profiles.
Notes:
- Call addOrUpdateMemberAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
userId | Sender ID |
attributes | Message |
options | Message options |
void onClearMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const MemberAttributeOptions& options)
Callback of the result of clearing all user profiles in a room.
Notes:
- Call clearMemberAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID generated for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
userId | Sender ID |
options | Message options |
void onDeleteMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const String keys[],
int numberOfKeys,
const MemberAttributeOptions& options)
Callback of the result of deleting room member profiles.
Notes:
- Call deleteMemberAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
userId | Sender ID |
keys | Profile array |
numberOfKeys | Number of profiles |
options | Message options |
void onQueryMemberAttributes(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Callback of the result of searching all room member profiles.
Notes:
- Call queryMemberAttributes to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
userId | Sender ID |
attributes | Fully set profiles |
void onQueryMemberAttributesByKeys(RequestId requestId,
const Code& code,
const RoomId& roomId,
UserId userId,
const Dictionary& attributes)
Callback of the result of searching specific profiles of room members.
Notes:
- Call queryMemberAttributesByKeys to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
roomId | Room ID |
userId | Sender ID |
attributes | Fully set profiles |
void onPeerMessageReceived(UserId userId, const Message& message)
A notification of this event will be received upon the receipt of P2P signaling messages.
Parameter | Description |
---|---|
userId | Sender ID |
message | Received signaling message |
void onSendMessage(RequestId requestId,
const Code& code,
UserId userId,
const Message& message,
const MessagingOptions& options)
This event carries the callback of sending P2P signaling messages.
Notes:
- Call sendMessage to preform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
userId | Sender ID |
message | Received signaling message |
options | Configuration information for sent signaling messages |
void onQueryUserOnlineStatus(RequestId requestId,
const Code& code,
const UserOnlineStatus status[],
int count)
Callback of the result of batch search for online users.
Notes:
- Call queryUserOnlineStatus to perform callback.
Parameter | Description |
---|---|
requestId | Request ID for the corresponding request |
code | Code ID for room operation result |
status | Search result |
count | Number of lists |
void onHummerLogWithLevel(HMRLogLevel level, const String& msg) = 0
Log output callback.
Parameter | Description |
---|---|
level | Level of logs to be output, see detaisl in HMRLogLevel |
msg | Logs to be output |