我正在将带有自定义参数的聊天消息发送到Quickblox api。
message: {
body: 'something',
date_sent: 'some date',
dialog_id: 'dialog id',
extension: {
save_to_history: 1,
},
markable: 1,
type: dialog.type === 3 ? 'chat' : 'groupchat',
customParameter: 'this is custom param',
},
我将其发送给quickblox这样的人
QB.chat.send(jidOrOpponentId, message);
[当我在其他浏览器上收到该消息时,它没有我的自定义参数。
有人知道是否应该将此自定义参数返回给我吗?如果不是,那是为了什么呢?我阅读了文档,其中有一节关于自定义参数,但是没有解释它们的用途,并且quickblox应该返回它们作为响应。
尝试将customParameter
放入extension
对象:
var msg = {
type: 'chat',
body: 'How are you today?',
extension: {
save_to_history: 1,
customParameter: 'Custom parameter'
}
};
var opponentId = 78;
QB.chat.send(opponentId, msg);