img

Message. img

new img()

img message
Returns:
message:object

Methods

set(options)

Building image message
Example
let message = New Message('img', id); 
message.set({
to: 'user1', 
file: file,
onFileUploadError: function(){}, 
onFileUploadComplete: function(){}, 
onFileUploadProgress: function(){}, 
width: '360',
height: '360',
ext: {},
chatType: 'singleChat', 
success: function(){}, 
fail: function(){}})
Parameters:
Name Type Description
options Object -
Properties
Name Type Description
to String The userId of the message recipient, group ID, or chat room ID
file Object file object
chatType String chat type, optional value: singleChat、groupChat、chatRoom
onFileUploadError function Callback for file upload error
onFileUploadComplete function Callback for file upload error complete
onFileUploadProgress function Callback of the file upload progress
width String width
width String height
ext Object The message extension
success function A callback that the message was sent successfully
fail function Callback for message sending failure
Returns:
Void