发送远程视频
/**
* 发送远程视频
*
* @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);
}
}
});
} |