|
void | sendMessage (final EMMessage msg) |
|
void | ackMessageRead (String to, String messageId) throws HyphenateException |
|
void | recallMessage (EMMessage message) throws HyphenateException |
|
void | aysncRecallMessage (final EMMessage message, final EMCallBack callback) |
|
EMMessage | getMessage (String messageId) |
|
EMConversation | getConversation (String id) |
|
EMConversation | getConversation (String id, EMConversationType type) |
|
EMConversation | getConversation (String username, EMConversationType type, boolean createIfNotExists) |
|
void | markAllConversationsAsRead () |
|
int | getUnreadMsgsCount () |
|
int | getUnreadMessageCount () |
|
void | saveMessage (EMMessage message) |
|
boolean | updateMessage (EMMessage message) |
|
void | downloadAttachment (final EMMessage msg) |
|
void | downloadThumbnail (final EMMessage msg) |
|
synchronized void | importMessages (List< EMMessage > msgs) |
|
List< EMConversation > | getConversationsByType (EMConversationType type) |
|
void | downloadFile (final String remoteUrl, final String localFilePath, final Map< String, String > headers, final EMCallBack callback) |
|
Map< String, EMConversation > | getAllConversations () |
|
void | loadAllConversations () |
|
boolean | deleteConversation (String username, boolean deleteMessages) |
|
void | addMessageListener (EMMessageListener listener) |
|
void | removeMessageListener (EMMessageListener listener) |
|
void | addConversationListener (EMConversationListener listener) |
|
void | removeConversationListener (EMConversationListener listener) |
|
void | setMessageListened (EMMessage message) |
|
void | setVoiceMessageListened (EMMessage message) |
|
boolean | updateParticipant (String from, String changeTo) |
|
EMCursorResult< EMMessage > | fetchHistoryMessages (String conversationId, EMConversationType type, int pageSize, String startMsgId) throws HyphenateException |
|
void | asyncFetchHistoryMessage (final String conversationId, final EMConversationType type, final int pageSize, final String startMsgId, final EMValueCallBack< EMCursorResult< EMMessage >> callBack) |
|
|
| EMChatManager (EMClient client, EMAChatManager manager) |
|
send a message EMMessage msg = EMMessage; EMClient.getInstance().chatManager().sendMessage(msg);
void com.hyphenate.chat.EMChatManager.ackMessageRead |
( |
String |
to, |
|
|
String |
messageId |
|
) |
| throws HyphenateException |
send read ack to server
- Parameters
-
to | the recipient id |
messageId | message id |
- Exceptions
-
add conversation listener
- See also
- EMConversationListener refresh the conversation list when receiving the conversation refresh event
- Parameters
-
listener | the conversation listener |
void com.hyphenate.chat.EMChatManager.addMessageListener |
( |
EMMessageListener |
listener | ) |
|
add message listener
- See also
- EMMessageListener
- Parameters
-
listener | the message listener which is used to monitor the incoming messages |
fetch conversation roam messages from server.
- Parameters
-
conversationId | the conversation id which select to fetch roam message. |
type | the conversation type which select to fetch roam message. |
pageSize | the page size. |
startMsgId | the start search roam message, if empty start from the server lastest message. |
callBack | server return messages and cursor for next fetch action. |
boolean com.hyphenate.chat.EMChatManager.deleteConversation |
( |
String |
username, |
|
|
boolean |
deleteMessages |
|
) |
| |
delete conversation and messages from local database
- Parameters
-
username | user id or group id |
deleteMessages | whether delete messages |
- Returns
- return true if delete successfully
void com.hyphenate.chat.EMChatManager.downloadAttachment |
( |
final EMMessage |
msg | ) |
|
download the message attachement
- Parameters
-
msg | message to be downloaded |
void com.hyphenate.chat.EMChatManager.downloadFile |
( |
final String |
remoteUrl, |
|
|
final String |
localFilePath, |
|
|
final Map< String, String > |
headers, |
|
|
final EMCallBack |
callback |
|
) |
| |
download the file from server. Recommend using downloadAttachment(EMMessage msg) instead of this function.
- Parameters
-
remoteUrl | the remote file url |
localFilePath | the local file path |
headers | Http Request Headers |
callback | EMCallBack |
void com.hyphenate.chat.EMChatManager.downloadThumbnail |
( |
final EMMessage |
msg | ) |
|
download the thumbnail if not downloaded before
- Parameters
-
msg | the message to be downloaded |
fetch conversation roam messages from server.
- Parameters
-
conversationId | the conversation id which select to fetch roam message. |
type | the conversation type which select to fetch roam message. |
pageSize | the page size. |
startMsgId | the start search roam message, if empty start from the server lastest message. |
- Returns
- server return messages and cursor for next fetch action.
Map<String, EMConversation> com.hyphenate.chat.EMChatManager.getAllConversations |
( |
| ) |
|
get all conversations in the cache
- Returns
- conversations which is a map with key->conversation id : value->EMConversation
EMConversation com.hyphenate.chat.EMChatManager.getConversation |
( |
String |
id | ) |
|
get conversation by id
- Parameters
-
id | user id, group id or chatroom id |
- Returns
- EMConversation the existing conversation found by conversation, null if not found
get conversation by conversation id and conversation type, create a empty conversation if not found
- Parameters
-
id | user id, group id or chatroom id |
type | |
- See also
- EMConversationType the conversation type
- Returns
- EMConversation the conversation found according to the id and type, create a empty conversation if not found
get conversation by conversation id and conversation type
- Parameters
-
username | user id, group id or chatroom id |
type | |
- See also
- EMConversationType the conversation type
- Parameters
-
createIfNotExists | create conversation if not exists |
- Returns
get list of conversations by conversation type
- Parameters
-
- Returns
- list of conversation in specified type
EMMessage com.hyphenate.chat.EMChatManager.getMessage |
( |
String |
messageId | ) |
|
get message through message id
- Parameters
-
- Returns
int com.hyphenate.chat.EMChatManager.getUnreadMessageCount |
( |
| ) |
|
get unread message count
- Returns
int com.hyphenate.chat.EMChatManager.getUnreadMsgsCount |
( |
| ) |
|
synchronized void com.hyphenate.chat.EMChatManager.importMessages |
( |
List< EMMessage > |
msgs | ) |
|
import messages to local database. Make sure the meessage's sender or receiver is current user Recommend import up to 1000 messages per operation
- Parameters
-
msgs | the message list of be imported |
void com.hyphenate.chat.EMChatManager.loadAllConversations |
( |
| ) |
|
load all conversatons from local database
void com.hyphenate.chat.EMChatManager.markAllConversationsAsRead |
( |
| ) |
|
mark all messages as read
void com.hyphenate.chat.EMChatManager.recallMessage |
( |
EMMessage |
message | ) |
throws HyphenateException |
Recall the sent message
- Parameters
-
- Returns
remove the conversation listener
- Parameters
-
listener | the conversation listener set before |
void com.hyphenate.chat.EMChatManager.removeMessageListener |
( |
EMMessageListener |
listener | ) |
|
remove the message listener
- Parameters
-
listener | the message listener set before |
void com.hyphenate.chat.EMChatManager.saveMessage |
( |
EMMessage |
message | ) |
|
save the message to memory and local database CMD type message to will stored in database
- Parameters
-
void com.hyphenate.chat.EMChatManager.sendMessage |
( |
final EMMessage |
msg | ) |
|
void com.hyphenate.chat.EMChatManager.setMessageListened |
( |
EMMessage |
message | ) |
|
void com.hyphenate.chat.EMChatManager.setVoiceMessageListened |
( |
EMMessage |
message | ) |
|
set message to listened, used for voice message
boolean com.hyphenate.chat.EMChatManager.updateMessage |
( |
EMMessage |
message | ) |
|
update the message
- Parameters
-
boolean com.hyphenate.chat.EMChatManager.updateParticipant |
( |
String |
from, |
|
|
String |
changeTo |
|
) |
| |
update database records, change username 'from' to 'changeTo', take effect on message table, conversation table, contacts, blacklist table note: this operation does not update data stored in memory cache.
- Parameters
-
- Returns
- operation result, if any update operations on those tables failed, result is false
The documentation for this class was generated from the following file:
- hyphenatechatsdk/src/com/hyphenate/chat/EMChatManager.java