EMChatroomManager

EMChatroomManager

new EMChatroomManager(manager)

Source:
EMChatroomManager constructor.
Parameters:
Name Type Description
manager Object

Methods

addListener(listener) → {void}

Source:
Add chatroom manager listener.
Parameters:
Name Type Description
listener EMChatroomManagerListener 添加的聊天室回调监听对象
Returns:
Type
void

changeChatroomDescription(chatroomId, newDescription) → {EMChatroom}

Source:
Change chatroom's description. Note: ONLY chatroom's owner can change chatroom's description.
Parameters:
Name Type Description
chatroomId String chatroom ID.
newDescription String The new chatroom description.
Returns:
The chatroom.
Type
EMChatroom

changeChatroomExtension(chatroomId, newExtension) → {EMChatroom}

Source:
Change chatroom's extension. Note: ONLY chatroom's owner can change chatroom's extension.
Parameters:
Name Type Description
chatroomId String chatroom ID.
newExtension String The new chatroom extension.
Returns:
The chatroom.
Type
EMChatroom

changeChatroomSubject(chatroomId, newSubject) → {EMChatroom}

Source:
Change chatroom's subject. Note: ONLY chatroom's owner can change chatroom's subject.
Parameters:
Name Type Description
chatroomId String chatroom ID.
newSubject String The new chatroom subject.
Returns:
Type
EMChatroom

chatroomWithId(chatroomId) → {Object}

Source:
Get the chatroom by chatroomId, create a chatroom if not existed.
Parameters:
Name Type Description
chatroomId String 聊天室ID
Returns:
EMChatroom array.
Type
Object

clearListeners() → {void}

Source:
Remove all the chatroom manager listeners.
Returns:
Type
void

createChatroom(subject, description, welcomeMessage, setting, members) → {EMChatroom}

Source:
Create a new chatroom. Note: Login user will be the owner of the chat room created.
Parameters:
Name Type Description
subject String chatroom's subject.
description String chatroom's description.
welcomeMessage String Welcoming message that will be sent to invited user.
setting String chatroom's setting.
members Array a list of chatroom's members.
Returns:
The chatroom created.
Type
EMChatroom

destroyChatroom(chatroomId) → {void}

Source:
Destroy a chatroom. Note: ONLY chatroom's owner can destroy the chatroom.
Parameters:
Name Type Description
chatroomId String chatroom ID.
Returns:
Type
void

fetchAllChatrooms() → {Array}

Source:
Fetch all chatrooms of the app.
Returns:
EMChatroom array.
Type
Array

fetchChatroomAnnouncement(chatroomId) → {EMChatroom}

Source:
fetch chat room announcement.
Parameters:
Name Type Description
chatroomId String chatroom ID.
Returns:
Type
EMChatroom

fetchChatroomBans(chatroomId, pageNum, pageSize) → {EMChatroom}

Source:
fetch chat room blacklist members. Note: If PageNum=0, then there is no pagination and will get all the users on the list. If PageNum=1, then will start from the first page of pagination.
Parameters:
Name Type Description
chatroomId String chatroom ID.
pageNum Number page number of pagination.
pageSize Number Page size. ex. 20 for 20 objects.
Returns:
Type
EMChatroom

fetchChatroomMembers(chatroomId, cursor, pageSize) → {EMChatroom}

Source:
get chatroom members.
Parameters:
Name Type Description
chatroomId String chatroom ID.
cursor String Page's cursor.
pageSize Number Page size. ex. 20 for 20 objects.
Returns:
The chatroom.
Type
EMChatroom

fetchChatroomMutes(chatroomId, pageNum, pageSizePage) → {Array}

Source:
fetch chat room mute members. Note: If PageNum=0, then there is no pagination and will get all the users on the list. If PageNum=1, then will start from the first page of pagination.
Parameters:
Name Type Description
chatroomId String chatroom ID.
pageNum Number page number of pagination.
pageSizePage Number Page size. ex. 20 for 20 objects.
Returns:
object list. The list of mute users. object like { "key" : name, "value" : 111 }.
Type
Array

fetchChatroomSpecification(chatroomId, fetchMembers) → {EMChatroom}

Source:
Get chatroom's specifications.
Parameters:
Name Type Description
chatroomId String chatroom ID.
fetchMembers Bool Wether to fetch members in the chatroom.
Returns:
The chatroom.
Type
EMChatroom

fetchChatroomsWithCursor(cursor, pageSize) → {EMPageResult}

Source:
Get the chatroom by chatroom id.
Parameters:
Name Type Description
cursor String Page's cursor.
pageSize Number Page size. ex. 20 for 20 objects.
Returns:
The chatroom.
Type
EMPageResult

fetchChatroomsWithPage(pageNum, pageSize) → {EMPageResult}

Source:
Get the chatroom by chatroom id.
Parameters:
Name Type Description
pageNum Number page number of pagination.
pageSize Number Page size. ex. 20 for 20 objects.
Returns:
Type
EMPageResult

joinChatroom(chatroomId) → {EMChatroom}

Source:
Join a chatroom.
Parameters:
Name Type Description
chatroomId String chatroom ID.
Returns:
The chatroom.
Type
EMChatroom

joinedChatroomById(chatroomId) → {EMChatroom}

Source:
Get the chatroom by chatroom id.
Parameters:
Name Type Description
chatroomId String chatroom ID.
Returns:
Type
EMChatroom

leaveChatroom(chatroomId) → {void}

Source:
Join a chatroom.
Parameters:
Name Type Description
chatroomId String chatroom ID.
Returns:
Type
void

removeListener(listener) → {void}

Source:
Remove chatroom manager listener.
Parameters:
Name Type Description
listener EMChatroomManagerListener 移除的聊天室回调监听对象
Returns:
Type
void