Chat Room and Messages - TapUI
The following methods from the TapUI class can be used to open a chat room when UI implementation type is used.
TapTalk UI Chat Room Method
Description
Opens a chat room using the recipient user model. This method will directly open the chat room activity.
Opens a chat room using TapTalk.io user ID of the recipient user. This method will directly open the chat room activity.
Opens a chat room using client user ID of the recipient user. This method will directly open the chat room activity.
Opens a chat room using an available room model. This method will directly open the chat room activity.
Opens a chat room using an available room model. This method will directly open the chat room and scroll the view to the selected message.
Opens of the active user's Saved Messages chat room. This method will directly open the chat room activity.
Open Chat Room With User Model
Opens a chat room using the recipient user model. This method will directly open the chat room activity.
import io.taptalk.TapTalk.Manager.TapUI;
import io.taptalk.TapTalk.Model.TAPUserModel;
...
TapUI.getInstance().openChatRoomWithOtherUser(CONTEXT, RECIPIENT_USER);
Open Chat Room with TapTalk.io User ID
Opens a chat room using client user ID of the recipient user. This method will directly open the chat room activity.
import io.taptalk.TapTalk.Manager.TapUI;
import io.taptalk.TapTalk.Listener.TapCommonListener;
...
TapUI.getInstance().openChatRoomWithUserID(
CONTEXT,
USER_ID,
PREFILLED_TEXT,
CUSTOM_QUOTE_TITLE,
CUSTOM_QUOTE_CONTENT,
CUSTOM_QUOTE_IMAGE_URL,
USER_INFO,
new TapCommonListener() {
@Override
public void onSuccess(String successMessage) {
// Chat room opened successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
}
}
);
Open Chat Room with Client User ID
Opens a chat room using client user ID (XCUserID) of the recipient user. This method will directly open the chat room activity.
import io.taptalk.TapTalk.Manager.TapUI;
import io.taptalk.TapTalk.Listener.TapCommonListener;
...
TapUI.getInstance().openChatRoomWithXCUserID(
CONTEXT,
XC_USER_ID,
PREFFILED_TEXT,
CUSTOM_QUOTE_TITLE,
CUSTOM_QUOTE_CONTENT,
CUSTOM_QUOTE_IMAGE_URL,
USER_INFO,
new TapCommonListener() {
@Override
public void onSuccess(String successMessage) {
// Chat room opened successfully
}
@Override
public void onOpenRoomFailed(String errorMessage) {
}
}
);
Open Room with Room Model
Opens a chat room using an available room model. This method will directly open the chat room activity.
import io.taptalk.TapTalk.Manager.TapUI;
import io.taptalk.TapTalk.Model.TAPRoomModel;
...
TapUI.getInstance().openChatRoomWithRoomModel(CONTEXT, ROOM);
The openChatRoomWithRoomModel()
method with extra parameters below is used when you wish to set a predefined quote for the user in the opened chat room.
import io.taptalk.TapTalk.Manager.TapUI;
import io.taptalk.TapTalk.Model.TAPRoomModel;
...
TapUI.getInstance().openChatRoomWithRoomModel(
CONTEXT,
ROOM,
PREFILLED_TEXT,
CUSTOM_QUOTE_TITLE,
CUSTOM_QUOTE_CONTENT,
CUSTOM_QUOTE_IMAGE_URL,
USER_INFO
);
Open Room with Room Model & Scroll to Selected Message
Opens a chat room using an available room model. This method will directly open the chat room and scroll the view to the selected message.
import io.taptalk.TapTalk.Manager.TapUI;
import io.taptalk.TapTalk.Model.TAPRoomModel;
...
TapUI.getInstance().openChatRoomWithRoomModel(
CONTEXT,
ROOM,
SCROLL_TO_MESSAGE_WITH_LOCAL_ID
);
Open Saved Messages Chat Room
Opens of the active user's Saved Messages chat room. This method will directly open the chat room activity.
import io.taptalk.TapTalk.Manager.TapUI;
...
TapUI.getInstance().openSavedMessagesChatRoom(CONTEXT);
Last updated
Was this helpful?