
问题1
wfc.sendMessage(msg,
(messageId) => {
msg.messageId = messageId;
console.log('sf', messageId , 'prepared')
},
(progress, total) => {
console.log('sf', msg.messageId , 'progress')
console.log('sf', msg.messageId, Math.ceil(progress / total * 100),'progress')
let sm = conversationState.sendingMessages.find(e => e.messageId === msg.messageId);
if (sm) {
sm.progress = progress;
sm.total = total;
} else {
conversationState.sendingMessages.push({ messageId: msg.messageId, progress, total });
}
},
(messageUid) => {
console.log('sf', messageUid,' success')
conversationState.sendingMessages = conversationState.sendingMessages.filter(e => e.messageId !== msg.messageId);
},
(error) => {
console.log('sf', error.messageId, error,'error')
conversationState.sendingMessages = conversationState.sendingMessages.filter(e => e.messageId !== msg.messageId);
}
);
调用发送函数,发送图片,控制台日志sdk打印了
publish response GMPU
proto.min.js:1 publish response error b0.exports {cmd: 'puback', retain: false, qos: 0, dup: false, length: 371, …}cmd: "puback"dup: falselength: 371messageId: 57055payload: nullqos: 0reasonCode: 10retain: falsetopic: null[[Prototype]]: Object
proto.min.js:1 getUploadMediaUrl e -1
出现这种情况,wfc.sendMessage 没有任何回调,消息的状态也没有改变,一直是在发送中的状态
问题2
发送消息,消息状态有时候会回调失败,但是接收者会收到消息。