hyphenate_SDK3.0 3.7.6.3
hyphenate java IM SDK
Static Public Member Functions | Static Public Attributes | List of all members
com.hyphenate.chat.MessageEncoder Class Reference

Static Public Member Functions

static EMMessage getMsgFromJson (String jsonString)
 

Static Public Attributes

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"
 

Detailed Description

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

Member Function Documentation

◆ getMsgFromJson()

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

create message object from json string

Parameters
jsonString
Returns

Member Data Documentation

◆ 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


The documentation for this class was generated from the following file: