标题:
详解MChatManager(4)
[打印本页]
作者:
look_w
时间:
2019-4-12 15:33
标题:
详解MChatManager(4)
发送远程视频
/**
* 发送远程视频
*
* @param messageManager
* @param url
*/
public void sendRemoteVideoMessage(BmobIMConversation messageManager, String url) {
BmobIMVideoMessage msg = new BmobIMVideoMessage();
msg.setRemoteUrl(url);
messageManager.sendMessage(msg, new MessageSendListener() {
@Override
public void done(BmobIMMessage bmobIMMessage, BmobException e) {
if (mMessageListener != null) {
mMessageListener.onSendMessage(bmobIMMessage, Message.TYPE_VIDEO, e);
}
}
});
}
发送本地文件
/**
* 发送本地文件
*
* @param messageManager
* @param path
*/
public void sendLocalFileMessage(BmobIMConversation messageManager, String path) {
BmobIMFileMessage msg = new BmobIMFileMessage(path);
messageManager.sendMessage(msg, new MessageSendListener() {
@Override
public void done(BmobIMMessage bmobIMMessage, BmobException e) {
if (mMessageListener != null) {
mMessageListener.onSendMessage(bmobIMMessage, Message.TYPE_FILE, e);
}
}
});
}
发送远程文件
/**
* 发送远程文件
*
* @param messageManager
* @param url
*/
public void sendRemoteFileMessage(BmobIMConversation messageManager, String url) {
BmobIMFileMessage msg = new BmobIMFileMessage();
msg.setRemoteUrl(url);
messageManager.sendMessage(msg, new MessageSendListener() {
@Override
public void done(BmobIMMessage bmobIMMessage, BmobException e) {
if (mMessageListener != null) {
mMessageListener.onSendMessage(bmobIMMessage, Message.TYPE_FILE, e);
}
}
});
}
发送地理位置
/**
* 发送地理位置
* @param messageManager
* @param address
* @param lat
* @param lng
*/
public void sendLocationMessage(BmobIMConversation messageManager,String address,double lat,double lng){
BmobIMLocationMessage msg=new BmobIMLocationMessage(address,lat,lng);
messageManager.sendMessage(msg, new MessageSendListener() {
@Override
public void done(BmobIMMessage bmobIMMessage, BmobException e) {
if(mMessageListener!=null){
mMessageListener.onSendMessage(bmobIMMessage,Message.TYPE_LOCATION,e);
}
}
});
}
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0