Public Callback Function | Method Signature |
---|---|
void | onUpdateHummerState(State fromState, State toState) |
Public Callback Function | Method Signature |
---|---|
void | onHummerTokenInvalid(TokenInvalidCode code, String desc) |
void | onHummerPreviousTokenExpired() |
Public Callback Function | Method Signature |
---|---|
void | onUpdateChannelState(ChannelState fromState, ChannelState toState) |
Public Callback Function | Function Name |
---|---|
void | beforeSendingMessage( Message message) |
void | afterSendingMessage(Message message) |
void | beforeReceivingMessage(Message message) |
void | afterReceivingMessage(Message message) |
void onUpdateHummerState(State fromState, State toState)
Callback of Hummer SDK status changes
Parameter | Description |
---|---|
fromState | Pre-change status. See details in HMR.State. |
toState | Current status |
void onHummerTokenInvalid(TokenInvalidCode code, String desc)
Notification of invalid authentication token
Note:
This callback is deprecated, use onHummerPreviousTokenExpired instead.
Parameter | Description |
---|---|
code | An invalid type. See details in HMR.TokenInvalidCode. |
desc | Invalidation reasons |
void onHummerPreviousTokenExpired()
Notification of Token expiration, which is trrigerd only when reconnecting. After receiving the callback, you should call refreshToken(String token, HMR.Completion completion) to update the Token.
public enum TokenInvalidCode {
EXPIRED(1);
}
Token invalid type
Bit operation | Description |
---|---|
EXPIRED(1) | Expired |
void onUpdateChannelState(ChannelState fromState, ChannelState toState);
Notification of change in SDK connection status
Parameter | Description |
---|---|
fromState | Pre-change status. See details in ChannelState. |
toState | Current status |
void onChatRoomDismissed(@NonNull ChatRoom chatRoom, @NonNull User member);
Callback notification upon chatroom closure
Note:
- Call dismissChatRoom to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
member | An administrator closing the chatroom |
void onBasicInfoChanged(@NonNull ChatRoom chatRoom,
@NonNull Map<ChatRoomInfo.BasicInfoType, String> propInfo);
Callback of changes to basic chatroom information
Note:
- Call changeBasicInfo to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
propInfo | A changed key-value pair. See BasicInfoType for reference enumeration of key values. |
void onRoomInfoAddedOrUpdated(@NonNull ChatRoom chatRoom,
@NonNull User operator,
@NonNull Map<String, String> propInfo);
Callback of chatroom information added or updated.
Note:
You can call addOrUpdateChatRoomInfo to trigger the callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
operator | Operator changed the chatroom information |
propInfo | Information changed |
void onMemberJoined(@NonNull ChatRoom chatRoom, @NonNull List<User> members);
Callback of members joining the chatroomm
Note:
- Call joinChatRoom to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
members | Members joining the chatroom |
void onMemberLeaved(@NonNull ChatRoom chatRoom,
@NonNull List<User> members,
int type,
@NonNull String reason);
Callback of members exiting the chatroom
Note:
This callback is deprecated, use onChatRoomMemberOffline or onChatRoomMemberLeave instead.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
members | Members exiting the chatroom |
type | Operation types for exiting the chatroom 0: LEAVING, 1: DISCONNECTED |
reason | Reasons for exiting the chatroom |
void onChatRoomMemberOffline(@NonNull ChatRoom chatRoom);
Callback of user exited the chatroom for network disconnect timeout
Note:
This callback is triggered only when the network disconnect timeout
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
void onChatRoomMemberLeave(@NonNull ChatRoom chatRoom, @NonNull List<User> members);
Callback of member exited the chatroom.
Note:
You can call leaveChatRoom to trigger the callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
members | Members exited the chatroom |
void onMemberCountChanged(@NonNull ChatRoom chatRoom, int count);
Callback of changes to chatroom member count
Note:
- Call joinChatRoom and leaveChatRoom to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
count | A changed count |
void onMemberKicked(@NonNull ChatRoom chatRoom,
@NonNull User admin,
@NonNull List<User> members,
@NonNull String reason);
Callback of chatroom members removal
Note:
This callback is deprecated, use onMemberKicked instead.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
admin | An administrator executing member removal |
members | Members removed from channel |
reason | Reasons for member removal |
void onMemberKicked(@NonNull ChatRoom chatRoom,
@NonNull User admin,
@NonNull List<User> members,
@NonNull KickOff kickOff);
Callback of member kicked out the chatroom.
Note:
You can call kick to trigger the callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
admin | Admin user |
members | Member kicked out of the chatroom |
kickOff | The reason for being kicked out, see details in KickOff |
void onRoleAdded(@NonNull ChatRoom chatRoom,
@NonNull String role,
@NonNull User admin,
@NonNull User fellow);
Callback of role adding to chatroom members
Note:
- Call addRole to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
role | An added role |
admin | An administrator adding a role |
fellow | Member to whom role was added |
void onRoleRemoved(@NonNull ChatRoom chatRooA request context object, callback pass-through to extract context from listenerm,
@NonNull String role,
@NonNull User admin,
@NonNull User fellow);
Callback of role removal from chatroom members
Note:
- Call removeRole to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
role | A removed role |
admin | An administrator removing a role |
fellow | Member from whom role was removed |
void onMemberMuted(@NonNull ChatRoom chatRoom,
@NonNull User operator,
@NonNull Set<User> members,
@Nullable String reason);
Callback of chatroom member muted
Note:
- Call muteMember to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
operator | An administrator for muting |
members | Muted members |
reason | Reason for muting |
void onMemberUnmuted(@NonNull ChatRoom chatRoom,
@NonNull User operator,
@NonNull Set<User> members,
@Nullable String reason);
Callback of chatroom members unmuted
Note:
- Call unmuteMember to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
operator | An administrator for unmuting |
members | Unmuted members |
reason | Reason |
void onUserInfoSet(@NonNull ChatRoom chatRoom,
@NonNull User user,
@NonNull Map<String, String> infoMap);
Callback of setting information of a chatroom member
Note:
- Call setUserInfo to perform callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
user | The user whose information changed |
infoMap | User information set |
void onUserInfoDeleted(@NonNull ChatRoom chatRoom,
@NonNull User user,
@NonNull Map<String, String> infoMap);
Callback of user information being deleted.
Note:
-You can call deleteUserInfoByKeys to trigger the callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
user | User The user whose information changed |
infoMap | Deleted user information |
void onUserInfoAddedOrUpdated(@NonNull ChatRoom chatRoom,
@NonNull User user,
@NonNull Map<String, String> infoMap);
Callback of the member information added or updated.
Note:
You can call addOrUpdateUserInfo to tigger the callback.
Parameter | Description |
---|---|
chatRoom | Chatroom ID |
user | User whose information changed |
infoMap | Deleted information |
void beforeSendingMessage(@NonNull Message message);
This callback precedes your calling ChatService.send(Message, HMR.Completion) to send a message.
It is commonly used to add the message to a session rendering interface before sending or to store the message in a database.
Parameter | Description |
---|---|
message | Message sent |
void afterSendingMessage(@NonNull Message message);
This callback occurs after you call ChatService.send(Message, HMR.Completion) to send a message (regardless of message sending success or failure).
Parameter | Description |
---|---|
message | Message sent |
void beforeReceivingMessage(@NonNull Message message);
Perform this callback before message receiving and processing.
Parameter | Description |
---|---|
message | Message received |
void afterReceivingMessage(@NonNull Message message);
Callback will be performed by this method when a new message is received.
Parameter | Description |
---|---|
message | Message received |