If you are using core implementation type, the application's chat room list can be managed with the TapCoreRoomListManager class using the following methods:
Get Updated Room List
Call this method to retrieve the latest room list data from the server and update to the local cache.
Call this method to fetch new/updated messages that have not yet been received by the device. Can be used to retrieve pending messages when the device goes back online after an offline state.
TapCoreRoomListManager.getInstance().fetchNewMessage(newTapCoreGetMessageListener() { @OverridepublicvoidonSuccess(List<TAPMessageModel> messages) {// Returns list of messages received by the user while the device is offline } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});
TapCoreRoomListManager.getInstance().fetchNewMessage(object : TapCoreGetMessageListener() {overridefunonSuccess(messages: List<TAPMessageModel>?) {// Returns list of messages received by the user while the device is offline }overridefunonError(errorCode: String?, errorMessage: String?) { }})
Search Local Room List
Call this method to search room lists from the device's local storage with a keyword. Provided keyword will be used to filter room name in the search result.
ParametersKEYWORD: (String) search keyword to filter room name
Mark Chat Room as Unread
Call this method to add the selected chat room ID to the marked as unread chat room list.
// Mark single chat room as unreadTapCoreRoomListManager.getInstance().markChatRoomAsUnread(ROOM_ID,newTapCommonListener() { @OverridepublicvoidonSuccess(String successMessage) {// Successfully marked chat room as unread } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});// Mark multiple chat rooms as unreadTapCoreRoomListManager.getInstance().markChatRoomsAsUnread(ROOM_IDS,newTapCommonListener() { @OverridepublicvoidonSuccess(String successMessage) {// Successfully marked chat rooms as unread } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});
// Mark single chat room as unreadTapCoreRoomListManager.getInstance().markChatRoomAsUnread(ROOM_ID, object : TapCommonListener() {overridefunonSuccess(successMessage: String?) {// Successfully marked chat room as unread }overridefunonError(errorCode: String?, errorMessage: String?) { }})// Mark multiple chat rooms as unreadTapCoreRoomListManager.getInstance().markChatRoomsAsUnread(ROOM_IDS, object : TapCommonListener() {overridefunonSuccess(successMessage: String?) {// Successfully marked chat rooms as unread }overridefunonError(errorCode: String?, errorMessage: String?) { }})
ParametersROOM_ID: (String) ID of the target room
ROOM_IDS: (List<String>) list containing IDs of target rooms
Remove Unread Mark from Chat Room
Call this method to remove the selected chat room ID from the marked as unread chat room list.
// Remove unread mark from single chat roomTapCoreRoomListManager.getInstance().removeUnreadMarkFromChatRoom(ROOM_ID,newTapCommonListener() { @OverridepublicvoidonSuccess(String successMessage) {// Successfully removed unread mark from chat room } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});// Remove unread mark from multiple chat roomsTapCoreRoomListManager.getInstance().removeUnreadMarkFromChatRooms(ROOM_IDS,newTapCommonListener() { @OverridepublicvoidonSuccess(String successMessage) {// Successfully removed unread mark from chat rooms } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});
// Remove unread mark from single chat roomTapCoreRoomListManager.getInstance().removeUnreadMarkFromChatRoom(ROOM_ID, object : TapCommonListener() {overridefunonSuccess(successMessage: String?) {// Successfully removed unread mark from chat room }overridefunonError(errorCode: String?, errorMessage: String?) { }})// Remove unread mark from multiple chat roomsTapCoreRoomListManager.getInstance().removeUnreadMarkFromChatRooms(ROOM_IDS, object : TapCommonListener() {overridefunonSuccess(successMessage: String?) {// Successfully removed unread mark from chat rooms }overridefunonError(errorCode: String?, errorMessage: String?) { }})
ParametersROOM_ID: (String) ID of the target room
ROOM_IDS: (List<String>) list containing IDs of target rooms
Get Marked as Unread Chat Room List
Call this method to retrieve the list of chat room IDs that has been marked as unread.
TapCoreRoomListManager.getInstance().getMarkedAsUnreadChatRoomList(newTapCoreGetStringArrayListener() { @OverridepublicvoidonSuccess(ArrayList<String> arrayList) {// Returns list of roomID that has been marked as unread } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});
TapCoreRoomListManager.getInstance().getMarkedAsUnreadChatRoomList(object : TapCoreGetStringArrayListener() {overridefunonSuccess(arrayList: ArrayList<String>) {// Returns list of roomID that has been marked as unread }overridefunonError(errorCode: String?, errorMessage: String?) { }});
Mute/Unmute Chat Room
Call these methods to mute the selected chat rooms until a specified time. Active user will not receive notifications from muted chat rooms.
ParametersROOM_ID: (String) ID of the target room
ROOM_IDS: (List<String>) list containing IDs of target rooms
EXPIRED_AT: (Long) chat room will stay muted until this time, fill with 0L to mute the room forever or until the room is unmuted
To return chat rooms to its normal state and continue retrieving notifications, use unmuteChatRoom() method.
ParametersROOM_ID: (String) ID of the target room
ROOM_IDS: (List<String>) list containing IDs of target rooms
Get Muted Chat Rooms
Retrieve the list of muted chat room IDs and their respective mute expiry time.
TapCoreRoomListManager.getInstance().getMutedChatRoomList(newTapCoreGetMutedChatRoomListener() { @OverridepublicvoidonSuccess(@NonNullArrayList<TapMutedRoomListModel> mutedRoomList) {// Returns list of TapMutedRoomListModel which contains // roomID and expiry time of the muted chat rooms } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});
TapCoreRoomListManager.getInstance().getMutedChatRoomList(ROOM_ID, object : TapCoreGetMutedChatRoomListener() {overridefunonSuccess(mutedRoomList: ArrayList<TapMutedRoomListModel>) {// Returns list of TapMutedRoomListModel which contains // roomID and expiry time of the muted chat rooms }overridefunonError(errorCode: String?, errorMessage: String?) { }})
Pin/Unpin Chat Room
You may call pinChatRoom() to add or remove the chat room ID to pinned chat room list. Chat rooms pinned by the user are generally shown on top of the chat room list. You can later retrieve the list of pinned chat room IDs with getPinnedChatRoomIDs().
ParametersROOM_ID: (String) ID of the target room
ROOM_IDS: (List<String>) list containing IDs of target rooms
Get Pinned Chat Rooms
You can retrieve the list of the active user's pinned chat room IDs from the server with getPinnedChatRoomIDs().
TapCoreRoomListManager.getInstance().getPinnedChatRoomIDs(newTapCoreGetStringArrayListener() { @OverridepublicvoidonSuccess(@NonNullArrayList<String> pinnedRoomIDs) {// Returns list of roomID of the active user's pinned chat rooms } @OverridepublicvoidonError(String errorCode,String errorMessage) { }});
TapCoreRoomListManager.getInstance().getPinnedChatRoomIDs(ROOM_ID, object : TapCoreGetStringArrayListener() {overridefunonSuccess(pinnedRoomIDs: ArrayList<String>) {// Returns list of roomID of the active user's pinned chat rooms }overridefunonError(errorCode: String?, errorMessage: String?) { }})