createFileMessage static method
Object
createFileMessage(
{ - required String userID,
- required dynamic file,
- String convType = 'C2C',
- String cloudCustomData = '',
- required dynamic progressCallback,
- bool needReadReceipt = false,
- int priority = 0,
})
Implementation
static Object createFileMessage(
{required String userID,
required file,
String convType = 'C2C',
String cloudCustomData = '',
required progressCallback,
bool needReadReceipt = false,
int priority = 0}) {
final textParams = {
"to": userID,
"conversationType": convType,
"cloudCustomData": cloudCustomData,
"needReadReceipt": needReadReceipt,
"priority": MessagePriorityWeb.convertMsgPriorityToWeb(priority),
"payload": mapToJSObj({"file": file}),
"onProgress": progressCallback
};
return mapToJSObj(textParams);
}