HeavyRain
发送图片前先上传,上传成功后把链接放到图片消息的remoteUrl属性,发送消息就好了
String imageUrl = "https://img1.baidu.com/it/u=3392591833,1640391553&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=714";
ImageMessageContent imgContent = new ImageMessageContent();
imgContent.remoteUrl = imageUrl;
Message msg = new Message();
msg.conversation = conversation;
msg.content = imgContent;
ChatManager.Instance().sendMessage(msg, new SendMessageCallback() {
@Override
public void onSuccess(long messageUid, long timestamp) {
Log.e("fhxx", "成功");
}
@Override
public void onFail(int errorCode) {
Log.e("fhxx", "onFail" + errorCode);
}
@Override
public void onPrepare(long messageId, long savedTime) {
}
});
这样子写有问题么,为什么发送不出去呢,求解