hyphenate_SDK3.0
3.8.5
hyphenatejavaIMSDK
|
Classes | |
enum | ChatType |
enum | Direct |
class | EMCallbackHolder |
enum | Status |
enum | Type |
Public Member Functions | |
Status | status () |
EMMessage (EMAMessage message) | |
void | setStatus (Status status) |
Type | getType () |
EMMessageBody | getBody () |
long | getMsgTime () |
void | setMsgTime (long msgTime) |
long | localTime () |
void | setLocalTime (long serverTime) |
boolean | isNeedGroupAck () |
void | setIsNeedGroupAck (boolean need) |
int | groupAckCount () |
void | setGroupAckCount (int count) |
void | setBody (EMMessageBody body) |
void | addBody (EMMessageBody body) |
String | getFrom () |
void | setFrom (String from) |
void | setTo (String to) |
String | getTo () |
String | getMsgId () |
void | setMsgId (String msgId) |
synchronized void | setMessageStatusCallback (EMCallBack callback) |
String | toString () |
void | setAttribute (String attribute, boolean value) |
void | setAttribute (String attribute, int value) |
void | setAttribute (String attribute, long value) |
void | setAttribute (String attribute, JSONObject value) |
void | setAttribute (String attribute, JSONArray value) |
void | setAttribute (String attribute, String value) |
boolean | getBooleanAttribute (String attribute) throws HyphenateException |
boolean | getBooleanAttribute (String attribute, boolean defaultValue) |
int | getIntAttribute (String attribute, int defaultValue) |
long | getLongAttribute (String attribute, long defaultValue) |
int | getIntAttribute (String attribute) throws HyphenateException |
long | getLongAttribute (String attribute) throws HyphenateException |
String | getStringAttribute (String attribute) throws HyphenateException |
String | getStringAttribute (String attribute, String defaultValue) |
JSONObject | getJSONObjectAttribute (String attribute) throws HyphenateException |
JSONArray | getJSONArrayAttribute (String attribute) throws HyphenateException |
ChatType | getChatType () |
void | setChatType (ChatType chatType) |
int | describeContents () |
void | writeToParcel (Parcel out, int flags) |
Object | clone () throws CloneNotSupportedException |
boolean | isAcked () |
void | setAcked (boolean isAcked) |
boolean | isDelivered () |
void | setDelivered (boolean isDelivered) |
boolean | isUnread () |
void | setUnread (boolean unread) |
boolean | isListened () |
void | setListened (boolean isListened) |
String | getUserName () |
void | setDeliverAcked (boolean isDeliverAcked) |
int | progress () |
void | setProgress (int progress) |
Direct | direct () |
void | setDirection (Direct dir) |
String | conversationId () |
Map< String, Object > | ext () |
Static Public Member Functions | |
static EMMessage | createSendMessage (Type type) |
static EMMessage | createReceiveMessage (Type type) |
static EMMessage | createTxtSendMessage (String content, String username) |
static EMMessage | createVoiceSendMessage (String filePath, int timeLength, String username) |
static EMMessage | createVoiceSendMessage (Uri filePath, int timeLength, String username) |
static EMMessage | createImageSendMessage (String filePath, boolean sendOriginalImage, String username) |
static EMMessage | createImageSendMessage (Uri imgUri, boolean sendOriginalImage, String username) |
static EMMessage | createVideoSendMessage (String videofilePath, String imageThumbPath, int timeLength, String username) |
static EMMessage | createVideoSendMessage (Uri videofilePath, String imageThumbPath, int timeLength, String username) |
static EMMessage | createVideoSendMessage (Uri videofilePath, Uri imageThumbPath, int timeLength, String username) |
static EMMessage | createLocationSendMessage (double latitude, double longitude, String locationAddress, String username) |
static EMMessage | createFileSendMessage (String filePath, String username) |
static EMMessage | createFileSendMessage (Uri filePath, String username) |
Static Public Attributes | |
static final Parcelable.Creator< EMMessage > | CREATOR |
Message object, represent a sent/received message
Construct a new send text message
EMMessage msg = EMMessage.createSendMessage(EMMessage.Type.TXT); msg.setTo("user1"); TextMessageBody body = new TextMessageBody("hello from hyphenate sdk"); msg.addBody(body);
Construct a new receive text message
EMMessage msg = EMMessage.createSendMessage(EMMessage.Type.IMAGE); msg.setTo("user1"); ImageMessageBody body = new ImageMessageBody(imageFileUrl); msg.addBody(body);
void com.hyphenate.chat.EMMessage.addBody | ( | EMMessageBody | body | ) |
Add a message body Only support add one now
body | The message body |
String com.hyphenate.chat.EMMessage.conversationId | ( | ) |
Get conversation id
|
static |
Create a normal file send message
filePath | The path of the file |
username | The recipient(user or group) id |
|
static |
Create a normal file send message
filePath | The path of the file |
username | The recipient(user or group) id |
|
static |
Create a image send message
filePath | The path of the image |
sendOriginalImage | Whether to send the original(if image greater than 100k sdk will be compressed) |
username | The recipient(user or group) id |
|
static |
Create a image send message
imgUri | The uri of the image |
sendOriginalImage | Whether to send the original(if image greater than 100k sdk will be compressed) |
username | The recipient(user or group) id |
|
static |
Create a location send message
latitude | The latitude |
longitude | The longitude |
locationAddress | Location details |
username | The recipient(user or group) id |
Create a new receive message
type | The message type |
Create a new send message
type | The message type |
|
static |
Create a text send message
content | Text content |
username | The recipient(user or group) id |
|
static |
Create a video send message
videofilePath | The path of the video file |
imageThumbPath | The path of the thumbnail |
timeLength | The length of the video time, unit s |
username | The recipient(user or group) id |
|
static |
Create a video send message
videofilePath | The path of the video file |
imageThumbPath | The path of the thumbnail |
timeLength | The length of the video time, unit s |
username | The recipient(user or group) id |
|
static |
Create a video send message
videofilePath | The path of the video file |
imageThumbPath | The path of the thumbnail |
timeLength | The length of the video time, unit s |
username | The recipient(user or group) id |
|
static |
Create a voice send message
filePath | The path of the voice file |
timeLength | The time length of the voice(unit s) |
username | The recipient(user or group) id |
|
static |
Create a voice send message
filePath | The uri of the voice file |
timeLength | The time length of the voice(unit s) |
username | The recipient(user or group) id |
Map<String, Object> com.hyphenate.chat.EMMessage.ext | ( | ) |
Get message extension, return type is Map<String, Object>
EMMessageBody com.hyphenate.chat.EMMessage.getBody | ( | ) |
Get message body
boolean com.hyphenate.chat.EMMessage.getBooleanAttribute | ( | String | attribute | ) | throws HyphenateException |
Get a boolean type extra attribute
attribute | Attribute key |
HyphenateException |
boolean com.hyphenate.chat.EMMessage.getBooleanAttribute | ( | String | attribute, |
boolean | defaultValue | ||
) |
Get a boolean type extra attribute
attribute | Attribute key |
defaultValue | the default value you want |
String com.hyphenate.chat.EMMessage.getFrom | ( | ) |
Get the sender id
int com.hyphenate.chat.EMMessage.getIntAttribute | ( | String | attribute, |
int | defaultValue | ||
) |
Get a int type extra attribute
attribute | Attribute key |
defaultValue | The default value you want |
int com.hyphenate.chat.EMMessage.getIntAttribute | ( | String | attribute | ) | throws HyphenateException |
Get a int type extra attribute
attribute | Attribute key |
HyphenateException |
JSONArray com.hyphenate.chat.EMMessage.getJSONArrayAttribute | ( | String | attribute | ) | throws HyphenateException |
Get a JSONArray type attribute
attribute | Attribute key |
HyphenateException |
JSONObject com.hyphenate.chat.EMMessage.getJSONObjectAttribute | ( | String | attribute | ) | throws HyphenateException |
Get a JSONObject type attribute
attribute | Attribute key |
HyphenateException |
long com.hyphenate.chat.EMMessage.getLongAttribute | ( | String | attribute, |
long | defaultValue | ||
) |
Get a long type extra attribute
attribute | Attribute key |
defaultValue | The default value you want |
long com.hyphenate.chat.EMMessage.getLongAttribute | ( | String | attribute | ) | throws HyphenateException |
Get long type extra attribute
attribute | Attribute key |
HyphenateException |
String com.hyphenate.chat.EMMessage.getMsgId | ( | ) |
Get message id
long com.hyphenate.chat.EMMessage.getMsgTime | ( | ) |
Get message timestamp(server time)
String com.hyphenate.chat.EMMessage.getStringAttribute | ( | String | attribute | ) | throws HyphenateException |
Get a string type extra attribute
attribute | Attribute key |
HyphenateException |
String com.hyphenate.chat.EMMessage.getStringAttribute | ( | String | attribute, |
String | defaultValue | ||
) |
Get a string type extra attribute
attribute | Attribute key |
defaultValue | The default value you want |
String com.hyphenate.chat.EMMessage.getTo | ( | ) |
Get receiver name
Type com.hyphenate.chat.EMMessage.getType | ( | ) |
获取消息类型
Get message chat type
String com.hyphenate.chat.EMMessage.getUserName | ( | ) |
Get the peer's id
int com.hyphenate.chat.EMMessage.groupAckCount | ( | ) |
Read ack number of group message
boolean com.hyphenate.chat.EMMessage.isAcked | ( | ) |
whether to read ack by the other
boolean com.hyphenate.chat.EMMessage.isDelivered | ( | ) |
Delivery Ack, check if the peer has received the message
boolean com.hyphenate.chat.EMMessage.isListened | ( | ) |
Get whether the message has been listened
boolean com.hyphenate.chat.EMMessage.isNeedGroupAck | ( | ) |
Message if need group read ack
boolean com.hyphenate.chat.EMMessage.isUnread | ( | ) |
Check if the message has been read
long com.hyphenate.chat.EMMessage.localTime | ( | ) |
Get local timestamp
int com.hyphenate.chat.EMMessage.progress | ( | ) |
Indicate message attachment upload or download progress, value ranges between 0-100 For message attachment's thumbnail, it doesn't has progress information
void com.hyphenate.chat.EMMessage.setAcked | ( | boolean | isAcked | ) |
Sets whether the other has been read Not supposed to be called by app
isAcked |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
boolean | value | ||
) |
Set a boolean type extra attributes of the message
attribute | Attribute key |
value | Attribute value |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
int | value | ||
) |
Set a int type extra attributes of the message
attribute | Attribute key |
value | Attribute value |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
long | value | ||
) |
Set a long type extra attributes of the message
attribute | Attribute key |
value | Attribute value |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
JSONObject | value | ||
) |
Set a JSONObject type extra attributes of the message
attribute | Attribute key |
value | Attribute value |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
JSONArray | value | ||
) |
Set a JSONArray type extra attributes of the message
attribute | Attribute key |
value | Attribute value |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
String | value | ||
) |
Set a string type extra attributes of the message
attribute | Attribute key |
value | Attribute value |
void com.hyphenate.chat.EMMessage.setBody | ( | EMMessageBody | body | ) |
set message body
body |
void com.hyphenate.chat.EMMessage.setChatType | ( | ChatType | chatType | ) |
Set chat type The default is single chat ChatType#Chat
chatType | see ChatType |
void com.hyphenate.chat.EMMessage.setDeliverAcked | ( | boolean | isDeliverAcked | ) |
Set message deliver ack Not supposed to be called by app
isDeliverAcked |
void com.hyphenate.chat.EMMessage.setDelivered | ( | boolean | isDelivered | ) |
Sets whether the message has been delivered Not supposed to be called by app
isDelivered |
void com.hyphenate.chat.EMMessage.setDirection | ( | Direct | dir | ) |
Set message direction
dir | Message direction, see Direct |
void com.hyphenate.chat.EMMessage.setFrom | ( | String | from | ) |
Set message sender id
from | Sender id |
void com.hyphenate.chat.EMMessage.setGroupAckCount | ( | int | count | ) |
Set read ack number of group message
count |
void com.hyphenate.chat.EMMessage.setIsNeedGroupAck | ( | boolean | need | ) |
Set message if need group read ack
need |
void com.hyphenate.chat.EMMessage.setListened | ( | boolean | isListened | ) |
Sets whether the other has been listened
isListened |
void com.hyphenate.chat.EMMessage.setLocalTime | ( | long | serverTime | ) |
Set message local time
serverTime | Message local time |
synchronized void com.hyphenate.chat.EMMessage.setMessageStatusCallback | ( | EMCallBack | callback | ) |
Set message status callback Your app should set emaObject callback to get message status and then refresh the ui accordingly
callback |
void com.hyphenate.chat.EMMessage.setMsgId | ( | String | msgId | ) |
Set local message id
msgId | Message id |
void com.hyphenate.chat.EMMessage.setMsgTime | ( | long | msgTime | ) |
Set message timestamp (server time)
msgTime | Message timestamp (server time) |
void com.hyphenate.chat.EMMessage.setProgress | ( | int | progress | ) |
Set message attachment upload or download progress, value ranges between 0-100 For app developing, it doesn't need to set progress
progress |
void com.hyphenate.chat.EMMessage.setStatus | ( | Status | status | ) |
Set the status of the message
status | Status of the message |
void com.hyphenate.chat.EMMessage.setTo | ( | String | to | ) |
Sets the receiver ID of the message
to | The receiver ID |
Status com.hyphenate.chat.EMMessage.status | ( | ) |
Get the send/receive status of message
|
static |