hyphenate_SDK3.0  3.6.1
hyphenatejavaIMSDK
静态 Public 成员函数 | 静态 Public 属性 | 所有成员列表
com.hyphenate.chat.MessageEncoder类 参考

静态 Public 成员函数

static EMMessage getMsgFromJson (String jsonString)
 

静态 Public 属性

static final String ATTR_TYPE = "type"
 
static final String ATTR_TO = "to"
 
static final String ATTR_FROM = "from"
 
static final String ATTR_MSG = "msg"
 
static final String ATTR_URL = "url"
 
static final String ATTR_LOCALURL = "localurl"
 
static final String ATTR_THUMB_LOCALURL = "thumblocalurl"
 
static final String ATTR_FILENAME = "filename"
 
static final String ATTR_THUMBNAIL = "thumb"
 
static final String ATTR_SECRET = "secret"
 
static final String ATTR_SIZE = "size"
 
static final String ATTR_IMG_WIDTH = "width"
 
static final String ATTR_IMG_HEIGHT = "height"
 
static final String ATTR_THUMBNAIL_SECRET = "thumb_secret"
 
static final String ATTR_LENGTH = "length"
 
static final String ATTR_ADDRESS = "addr"
 
static final String ATTR_LATITUDE = "lat"
 
static final String ATTR_LONGITUDE = "lng"
 
static final String ATTR_ACTION = "action"
 
static final String ATTR_PARAM = "param"
 
static final String ATTR_FILE_LENGTH = "file_length"
 
static final String ATTR_EXT = "ext"
 

详细描述

this class is used to encode the domain EMMessage object into json string payload which will be transfered in xmpp.chat.body attribute it also responsible decode the received xmpp payload in json back to EMMessage object

成员函数说明

◆ getMsgFromJson()

static EMMessage com.hyphenate.chat.MessageEncoder.getMsgFromJson ( String  jsonString)
static

create message object from json string

参数
jsonString
返回

类成员变量说明

◆ ATTR_TYPE

final String com.hyphenate.chat.MessageEncoder.ATTR_TYPE = "type"
static

notice that the json msg send on the wire is different from json string saved in local db. for example. image message, the local db will save localurl attribute, whitch wont send over


该类的文档由以下文件生成: