Group Chat
If you are using core implementation method, you can use the methods from the TapCoreChatRoomManager and TapCoreMessageManager class to manage group chat room.
TapTalk Group Chat Method
Description
Create Group Chat Room
Create a new group chat room with selected group name.
Create Group Chat Room with Picture
Create a new group chat room with selected group name and group picture.
Get Group Chat Room
Get group room data from selected group room ID.
Update Group Chat Room Details
Update existing group chat room data.
Update Group Image
Update group picture with current selected image.
Delete Group Chat Room
Delete group chat room and clear all chat data and participants.
Leave Group Chat
Leave from selected group chat.
Add Members to Group Chat
Add selected member(s) to current group chat room.
Remove Members from Group Chat
Remove selected member(s) from current group chat room.
Promote Group Admin
Promote selected member(s) as admin(s) to the current group chat room.
Demote Group Admin
Demote selected admin(s) to member(s) to the current group chat room.
Start Typing
Notify that the active user has started typing in the selected room.
Stop Typing
Notify that the active user has stopped typing in the selected room.
Send Text Message
Send a new text message to the selected chat room.
Send Location Message
Send a new message with location to the selected chat room.
Send Image Message
Send a new image message to the selected chat room.
Send Video Message
Send a new video message to the selected chat room.
Send File Message
Send a new file message to the selected chat room.
Forward a Message
Forward an existing message to the selected chat room.

Create Group Chat Room

Create a new group chat room with selected group name.
JavaScript
1
tapCoreChatRoomManager.createGroupChatRoom(GROUP_NAME, PARTICIPANT_LIST, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_NAME: (String) your group name PARTICIPANT_LIST: (List) list of the group participant's user IDs

Create Group Chat Room With Group Image

Create a new group chat room with selected group name and group picture.
JavaScript
1
tapCoreChatRoomManager.createGroupChatRoomWithPicture(GROUP_NAME, PARTICIPANT_LIST, IMAGE_FILE, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_NAME: (String) name of the group chat room to create PARTICIPANT_LIST: (List) list of the group participant's user IDs IMAGE_FILE: (File) picture to be uploaded as the group's profile

Get Group Chat Room

Get group room data from selected group room ID.
JavaScript
1
tapCoreChatRoomManager.getGroupChatRoom(GROUP_ID, {
2
onSuccess : (response) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of group

Update Group Chat Room Details

Create a new Update existing group chat room data.
JavaScript
1
tapCoreChatRoomManager.updateGroupChatRoomDetails(GROUP_ID, GROUP_NAME, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of group GROUP_NAME: (String) name of group

Update Group Image

Update group picture with current selected image.
JavaScript
1
tapCoreChatRoomManager.updateGroupPicture(GROUP_ID, IMAGE_FILE, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of the selected group IMAGE_FILE: (File) new picture for the group's profile

Delete Group Chat Room

Delete group chat room and clear all chat data and participants.
JavaScript
1
tapCoreChatRoomManager.deleteGroupChatRoom(ROOM_ID, {
2
onSuccess : (response) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters ROOM_ID: (String) a room id of the group to delete

Leave Group Chat

Leave from selected group chat.
JavaScript
1
tapCoreChatRoomManager.leaveGroupChatRoom(GROUP_ID, {
2
onSuccess : (isSuccess, responseMessage) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of the selected group

Add Members to Group Chat

Add selected member(s) to current group chat room.
JavaScript
1
tapCoreChatRoomManager.addGroupChatMembers(GROUP_ID, USER_IDs, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Remove Members from Group Chat

Remove selected member(s) from current group chat room.
JavaScript
1
tapCoreChatRoomManager.removeGroupChatMembers : (GROUP_ID, USER_IDs, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Promote Group Admin

Promote selected member(s) as admin(s) to the current group chat room.
JavaScript
1
tapCoreChatRoomManager.promoteGroupAdmins(GROUP_ID, USER_IDs, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Demote Group Admin

Demote selected admin(s) to member(s) to the current group chat room.
JavaScript
1
tapCoreChatRoomManager.demoteGroupAdmins(GROUP_ID, USER_IDs, {
2
onSuccess : (roomModel) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Send Start Typing

Notify that the active user has started typing in the selected room.
JavaScript
1
tapCoreChatRoomManager.sendStartTypingEmit(roomID)
Copied!
Parameters
ROOM_ID: (String) ID of the room where the user starts typing in

Send Stop Typing

Notify that the active user has stopped typing in the selected room.
JavaScript
1
tapCoreChatRoomManager.sendStopTypingEmit(roomID)
Copied!

Send Forward Messages

To send a forward message to a chat room, use the sendForwardMessage() method from the TapCoreMessageManager class.
JavaScript
1
tapCoreMessageManager.sendForwardMessage(ROOM_MODEL, (message) => {
2
// do action here
3
}, FORWARD_MESSAGES)
Copied!
Parameters ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent CALLBACK: (Method) callback method FORWARD_MESSAGES: (Array) array of forward messages

Send Forward Messages and Multiple Rooms

To send multiple forward message to multiple chat room, use the sendForwardMessagesOnMultipleRooms() method from the TapCoreMessageManager class.
JavaScript
1
let DATA = [{
2
room: {
3
...ROOM_MODEL
4
},
5
messages: [
6
{
7
...MESSAGE_MODEL
8
}
9
]
10
}]
11
12
tapCoreMessageManager.sendForwardMessagesOnMultipleRooms(DATA, (message) => {
13
// do action here
14
})
Copied!
Parameters DATA: (Array) array of room and forward messages CALLBACK: (Method) callback method

Send Forward Message

To send multiple forward message to a chat room, use the sendForwardMessage() method from the TapCoreMessageManager class.
JavaScript
1
tapCoreMessageManager.sendForwardMessage(ROOM_MODEL, (message) => {
2
// do action here
3
}, MESSAGE_MODEL)
Copied!
Parameters ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent CALLBACK: (Method) callback method MESSAGE_MODEL: (Object) object of forward message

Send Edit Message

To send an edit message to a chat room, use the sendEmitWithEditedMessage() method from the TapCoreMessageManager class.
JavaScript
1
tapCoreMessageManager.sendEmitWithEditedMessage(MESSAGE, NEW_MESSAGE, (message) => {
2
// do action here
3
})
Copied!
Parameters MESSAGE: (Object) message model of the edit message NEW_MESSAGE: (String) new message value CALLBACK: (Method) callback method

Send Text Message

To send a text message to a chat room, use the sendTextMessage() method from the TapCoreMessageManager class.
JavaScript
1
tapCoreMessageManager.sendTextMessage(MESSAGE_BODY, ROOM_MODEL, (message) => {
2
// do action here
3
})
Copied!
Parameters MESSAGE_BODY: (String) content of the message ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent

Send Location Message

You can send a location embedded in a chat message using sendLocationMessage(). This method takes latitude, longitude, and address text as parameters.
JavaScript
1
tapCoreMessageManager.sendLocationMessage(LATITUDE, LONGITUDE, ADDRESS, ROOM_MODEL, (message) => {
2
// do action here
3
})
Copied!
Parameters LATITUDE: (Double) latitude of the shared location LONGITUDE: (Double) longitude of the shared location ADDRESS: (String) text data containing the location address ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent

Send Image Message

To send an image to a chat room, you can use sendImageMessage() method by providing either file parameter.
JavaScript
1
tapCoreMessageManager.sendImageMessage(FILE, CAPTION, ROOM_MODEL, {
2
onStart: (messageModel) => {
3
// do action here
4
},
5
6
onProgress: (localID, percentage, bytes) => {
7
// do action here
8
},
9
10
onSuccess: (messageModel) => {
11
// do action here
12
},
13
14
onError: (errorCode, errorMessage) => {
15
// do action here
16
}
17
})
Copied!
Parameters FILE: (Uri) local Uri of the image file CAPTION: (String) caption for the image ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent

Send Video Message

To send a video to a chat room, you can use sendVideoMessage() method by providing the FILE.
JavaScript
1
tapCoreMessageManager.sendVideoMessage(file, caption, ROOM_MODEL, {
2
onStart: (messageModel) => {
3
// do action here
4
},
5
6
onProgress: (localID, percentage, bytes) => {
7
// do action here
8
},
9
10
onSuccess: (messageModel) => {
11
// do action here
12
},
13
14
onError: (errorCode, errorMessage) => {
15
// do action here
16
}
17
})
Copied!
Parameters FILE: (Uri) local Uri of the video file CAPTION: (String) caption for the video ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent

Send File Message

You can also send a file to a chat room using the sendFileMessage() method with a provided FILE.
JavaScript
1
tapCoreMessageManager.sendFileMessage(FILE, ROOM_MODEL, {
2
onStart: (messageModel) => {
3
// do action here
4
},
5
6
onProgress: (localID, percentage, bytes) => {
7
// do action here
8
},
9
10
onSuccess: (messageModel) => {
11
// do action here
12
},
13
14
onError: (errorCode, errorMessage) => {
15
// do action here
16
}
17
})
Copied!
Parameters FILE: (Uri) local Uri of the video file ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent

Send a Custom Message

To send a custom message that you just created above, call the sendCustomMessage() method with the custom message as a parameter.
JavaScript
1
tapCoreMessageManager.sendCustomMessage(MESSAGE_BODY, MESSAGE_DATA, MESSAGE_TYPE, ROOM_MODEL, (message) => {
2
// do action here
3
})
Copied!
Parameters MESSAGE_BODY: (String) content of the message ROOM_MODEL: (TAPRoomModel) the destination room where the message will be sent MESSAGE_TYPE: (Integer) type of your custom message, check the Message Type page for more information MESSAGE_DATA: (HashMap<String, Object>) custom data for the message (optional)

Download Message File

To start a file download from a File, Image, or Video message, you can use the downloadMessageFile() method.
JavaScript
1
tapCoreChatRoomManager.downloadMessageFile(messageModel, {
2
onSuccess : (response) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!
Parameters
MESSAGE: (TAPMessageModel) pending message with ongoing file upload

Mark Message as Read

To manually mark a message as read, call the markMessageAsRead() method.
JavaScript
1
tapCoreMessageManager.markMessageAsRead(ARRAY_OF_MESSAGE_ID)
Copied!
Parameters
ARRAY_OF_MESSAGE_ID: (TAPMessageModel) existing message to be marked as read

Mark Message as Delivered

To manually mark a message as delivered, call the markMessageAsDelivered() method.
JavaScript
1
tapCoreMessageManager.markMessageAsDelivered(ARRAY_OF_MESSAGE_ID)
Copied!
Parameters
ARRAY_OF_MESSAGE_ID: (TAPMessageModel) existing message to be marked as read

Get Older Messages from Chat Room

To retrieve older messages in a chat room from the server, use the getOlderMessagesBeforeTimestamp() method.
JavaScript
1
tapCoreMessageManager.getOlderMessagesBeforeTimestamp(ROOM_ID, NUMBER_OF_ITEMS, {
2
onSuccess: (messages, hasMore) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!

Get Newer Messages from Chat Room

To retrieve newer messages in a chat room from the server, use the getNewerMessagesAfterTimestamp() method.
JavaScript
1
tapCoreMessageManager.getNewerMessagesAfterTimestamp(ROOM_ID, {
2
onSuccess: (messages) => {
3
// do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
})
Copied!

Get Room Media

JavaScript
1
tapCoreChatRoomManager.getRoomMedia(ROOM_ID, {
2
onSuccess: (response) => {
3
//do action here
4
},
5
onError: (errorCode, errorMessage) => {
6
// do action here
7
}
8
}, minCreated = 0)
Copied!
Parameters ROOM_ID: (String) Group ID MIN_CREATED: (Long) Minimum Created Time in Millisecond. Leave empty if unnecessary