You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2022. It is now read-only.
比如sendMessage方法:
按照文档的调用
import { sendMessage, ConversationType, ObjectName } from "rongcloud-react-native-imlib";
const conversationType = ConversationType.PRIVATE;
const targetId = "userId"; // 根据会话类型的不同,可以是用户 ID、讨论组 ID、组群 ID 等
const content = { objectName: ObjectName.Text, content: "这是一个文本消息" };
const callback = {
success(messageId) {
console.log("发送成功:" + messageId);
},
error(errorCode) {
console.log("发送失败:" + errorCode);
}
};
sendMessage({ conversationType, targetId, content }, callback);
实际上是错误的。
要这样调用:
IMClient.sendMessage(
{ conversationType, targetId, content, pushContent, pushData },
{
success(messageId) {
resolve(messageId);
},
error(errorCode) {
reject(errorCode);
}
}
);