Quickblox javascript消息中的自定义参数

问题描述 投票:1回答:1

我正在将带有自定义参数的聊天消息发送到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应该返回它们作为响应。

javascript quickblox
1个回答
1
投票

尝试将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);
© www.soinside.com 2019 - 2024. All rights reserved.