hyphenate_SDK3.0
3.6.0
hyphenatejavaIMSDK
|
类 | |
enum | ChatType |
enum | Direct |
class | EMCallbackHolder |
enum | Status |
enum | Type |
Public 成员函数 | |
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) |
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 () |
Public 成员函数 继承自 com.hyphenate.chat.EMBase< EMAMessage > | |
boolean | equals (Object o) |
int | hashCode () |
静态 Public 成员函数 | |
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 | createImageSendMessage (String filePath, boolean sendOriginalImage, String username) |
static EMMessage | createVideoSendMessage (String videofilePath, String imageThumbPath, int timeLength, String username) |
static EMMessage | createLocationSendMessage (double latitude, double longitude, String locationAddress, String username) |
static EMMessage | createFileSendMessage (String filePath, String username) |
静态 Public 属性 | |
static final Parcelable.Creator< EMMessage > | CREATOR |
额外继承的成员函数 | |
Protected 属性 继承自 com.hyphenate.chat.EMBase< EMAMessage > | |
T | emaObject |
代表一条发送或接收到的消息
构造一条文本发送消息
EMMessage msg = EMMessage.createSendMessage(EMMessage.Type.TXT); msg.setTo("user1"); TextMessageBody body = new TextMessageBody("hello from hyphenate sdk"); msg.addBody(body);
构造一条图片消息
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 | ) |
添加消息体. (现在只支持添加一个 MesageBody)
body | 消息体 |
|
static |
创建一个普通文件发送消息
filePath | 文件路径 |
username | 消息接收人或群id |
|
static |
创建一个图片发送消息
filePath | 图片路径 |
sendOriginalImage | 是否发送原图(默认大于100K的图片sdk会进行压缩) |
username | 消息接收人或群id |
|
static |
创建一个位置发送消息
latitude | 纬度 |
longitude | 经度 |
locationAddress | 位置详情 |
username | 消息接收人或群id |
创建一个接收消息
type | 消息类型 |
创建一个发送消息
type | 消息类型 |
|
static |
创建一个文本发送消息
content | 文本内容 |
username | 消息接收人或群id |
|
static |
创建一个视频发送消息
videofilePath | 视频文件路径 |
imageThumbPath | 视频第一帧图缩略图 |
timeLength | 视频时间长度(单位秒) |
username | 消息接收人或群id |
|
static |
创建一个语音发送消息
filePath | 语音文件路径 |
timeLength | 语音时间长度(单位秒) |
username | 消息接收人或群id |
Direct com.hyphenate.chat.EMMessage.direct | ( | ) |
消息方向
Map<String, Object> com.hyphenate.chat.EMMessage.ext | ( | ) |
获取消息包含的全部扩展字段,并以Map形式返回
EMMessageBody com.hyphenate.chat.EMMessage.getBody | ( | ) |
获取消息的body
boolean com.hyphenate.chat.EMMessage.getBooleanAttribute | ( | String | attribute | ) | throws HyphenateException |
获取 boolean 类型扩展属性
attribute | 属性名 |
HyphenateException |
boolean com.hyphenate.chat.EMMessage.getBooleanAttribute | ( | String | attribute, |
boolean | defaultValue | ||
) |
获取 boolean 类型扩展属性
attribute | 属性名 |
defaultValue | 缺省值 |
String com.hyphenate.chat.EMMessage.getFrom | ( | ) |
获取消息发送者的用户名 get sender name
int com.hyphenate.chat.EMMessage.getIntAttribute | ( | String | attribute, |
int | defaultValue | ||
) |
获取 int 类型扩展属性
attribute | 属性名 |
defaultValue | 缺省值 |
int com.hyphenate.chat.EMMessage.getIntAttribute | ( | String | attribute | ) | throws HyphenateException |
获取 int 类型扩展属性
attribute | 属性名 |
HyphenateException |
JSONArray com.hyphenate.chat.EMMessage.getJSONArrayAttribute | ( | String | attribute | ) | throws HyphenateException |
获取 JSONArray 类型扩展属性
attribute | 属性名 |
HyphenateException |
JSONObject com.hyphenate.chat.EMMessage.getJSONObjectAttribute | ( | String | attribute | ) | throws HyphenateException |
获取 JSONObject 类型扩展属性
attribute | 属性名 |
HyphenateException |
long com.hyphenate.chat.EMMessage.getLongAttribute | ( | String | attribute, |
long | defaultValue | ||
) |
获取 long 类型扩展属性
attribute | 属性名 |
defaultValue | 缺省值 |
long com.hyphenate.chat.EMMessage.getLongAttribute | ( | String | attribute | ) | throws HyphenateException |
获取 long 类型扩展属性
attribute | 属性名 |
HyphenateException |
String com.hyphenate.chat.EMMessage.getMsgId | ( | ) |
获取消息的id
long com.hyphenate.chat.EMMessage.getMsgTime | ( | ) |
获取消息的时间(server time)
String com.hyphenate.chat.EMMessage.getStringAttribute | ( | String | attribute | ) | throws HyphenateException |
获取 String 类型扩展属性
attribute | 属性名 |
HyphenateException |
String com.hyphenate.chat.EMMessage.getStringAttribute | ( | String | attribute, |
String | defaultValue | ||
) |
获取 String 类型扩展属性
attribute | 属性名 |
defaultValue | 缺省值 |
String com.hyphenate.chat.EMMessage.getTo | ( | ) |
获取消息接收者的用户名
Type com.hyphenate.chat.EMMessage.getType | ( | ) |
获取消息类型
String com.hyphenate.chat.EMMessage.getUserName | ( | ) |
获取通话对象
boolean com.hyphenate.chat.EMMessage.isAcked | ( | ) |
对方是否已读
boolean com.hyphenate.chat.EMMessage.isDelivered | ( | ) |
获取消息是否已到达对方
boolean com.hyphenate.chat.EMMessage.isListened | ( | ) |
获取语音是否已听
boolean com.hyphenate.chat.EMMessage.isUnread | ( | ) |
unread flag
long com.hyphenate.chat.EMMessage.localTime | ( | ) |
获取消息的本地接收时间
int com.hyphenate.chat.EMMessage.progress | ( | ) |
消息包含附件的上传或者下载进度,值的范围0-100。 消息附件的缩略图不涉及进度信息
void com.hyphenate.chat.EMMessage.setAcked | ( | boolean | isAcked | ) |
设置对方是否已读
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
boolean | value | ||
) |
设置消息的boolean 类型扩展属性
attribute | 属性名 |
value,属性值 |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
int | value | ||
) |
设置消息的int 类型扩展属性
attribute | 属性名 |
value,属性值 |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
long | value | ||
) |
设置消息的long 类型扩展属性
attribute | 属性名 |
value,属性值 |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
JSONObject | value | ||
) |
设置消息的 JSONObject 类型扩展属性
attribute | 属性名 |
value,属性值 |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
JSONArray | value | ||
) |
设置消息的 JSONArray 类型扩展属性
attribute | 属性名 |
value,属性值 |
void com.hyphenate.chat.EMMessage.setAttribute | ( | String | attribute, |
String | value | ||
) |
设置消息的 string 类型扩展属性
attribute | 属性名 |
value,属性值 |
void com.hyphenate.chat.EMMessage.setChatType | ( | ChatType | chatType | ) |
void com.hyphenate.chat.EMMessage.setDirection | ( | Direct | dir | ) |
设置消息的方向
dir |
void com.hyphenate.chat.EMMessage.setFrom | ( | String | from | ) |
设置消息发送者
from |
void com.hyphenate.chat.EMMessage.setListened | ( | boolean | isListened | ) |
设置语音是否已听
isListened |
void com.hyphenate.chat.EMMessage.setLocalTime | ( | long | serverTime | ) |
设置消息的服务器时间
serverTime |
synchronized void com.hyphenate.chat.EMMessage.setMessageStatusCallback | ( | EMCallBack | callback | ) |
设置消息状态改变的回调
callback |
void com.hyphenate.chat.EMMessage.setMsgId | ( | String | msgId | ) |
设置消息id
msgId |
void com.hyphenate.chat.EMMessage.setMsgTime | ( | long | msgTime | ) |
设置消息时间(server time)
msgTime |
void com.hyphenate.chat.EMMessage.setProgress | ( | int | progress | ) |
对于app开发者来说,通常不需要主动设置进度,
void com.hyphenate.chat.EMMessage.setStatus | ( | Status | status | ) |
设置消息的状态
void com.hyphenate.chat.EMMessage.setTo | ( | String | to | ) |
设置消息的接收者
to |
Status com.hyphenate.chat.EMMessage.status | ( | ) |
消息的发送/接收状态:成功,失败,发送/接收过程中,创建成功待发送
|
static |