NIMSDK-AOS  10.9.71
静态 Public 成员函数 | 所有成员列表
com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator类 参考

静态 Public 成员函数

static V2NIMChatroomMessage createTextMessage (String text)
 构造文本消息 更多...
 
static V2NIMChatroomMessage createImageMessage (String imagePath, String name, String sceneName, Integer width, Integer height)
 构造图片消息 更多...
 
static V2NIMChatroomMessage createAudioMessage (String audioPath, String name, String sceneName, Integer duration)
 构造语音消息 更多...
 
static V2NIMChatroomMessage createVideoMessage (String videoPath, String name, String sceneName, Integer duration, Integer width, Integer height)
 构造视频消息 更多...
 
static V2NIMChatroomMessage createFileMessage (String filePath, String name, String sceneName)
 构造文件消息 更多...
 
static V2NIMChatroomMessage createLocationMessage (double latitude, double longitude, String address)
 构造地理位置消息 更多...
 
static V2NIMChatroomMessage createCustomMessage (String rawAttachment)
 构造自定义消息消息 更多...
 
static V2NIMChatroomMessage createCustomMessageWithAttachment (V2NIMMessageCustomAttachment attachment)
 构造自定义消息消息 更多...
 
static V2NIMChatroomMessage createCustomMessageWithAttachment (V2NIMMessageCustomAttachment attachment, int subType)
 构造自定义消息消息 更多...
 
static V2NIMChatroomMessage createForwardMessage (V2NIMChatroomMessage message)
 构造转发消息,消息内容与原消息一样 转发消息类型不能为:V2NIM_MESSAGE_TYPE_NOTIFICATION,V2NIM_MESSAGE_TYPE_ROBOT,V2NIM_MESSAGE_TYPE_TIP,V2NIM_MESSAGE_TYPE_AVCHAT 转发的消息消息必须为发送成功的消息 更多...
 
static V2NIMChatroomMessage createTipsMessage (String text)
 构造提示消息 更多...
 

详细描述

在文件 V2NIMChatroomMessageCreator.java19 行定义.

成员函数说明

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createAudioMessage ( String  audioPath,
String  name,
String  sceneName,
Integer  duration 
)
static

构造语音消息

参数
audioPath视频文件地址
name视频文件显示名称
sceneName文件存储场景名 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 传空默认使用:V2NIMStorageSceneConfig.DEFAULT_IM
duration语音文件播放长度
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java90 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createCustomMessage ( String  rawAttachment)
static

构造自定义消息消息

参数
rawAttachment需要发送的附件
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java208 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createCustomMessageWithAttachment ( V2NIMMessageCustomAttachment  attachment)
static

构造自定义消息消息

参数
attachment自定义消息附件
返回

在文件 V2NIMChatroomMessageCreator.java219 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createCustomMessageWithAttachment ( V2NIMMessageCustomAttachment  attachment,
int  subType 
)
static

构造自定义消息消息

参数
attachment自定义消息附件
subType自定义消息子类型
返回

在文件 V2NIMChatroomMessageCreator.java231 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createFileMessage ( String  filePath,
String  name,
String  sceneName 
)
static

构造文件消息

参数
filePath文件地址
name文件显示名称
sceneName场景名 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 传空默认使用:V2NIMStorageSceneConfig.DEFAULT_IM
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java165 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createForwardMessage ( V2NIMChatroomMessage  message)
static

构造转发消息,消息内容与原消息一样 转发消息类型不能为:V2NIM_MESSAGE_TYPE_NOTIFICATION,V2NIM_MESSAGE_TYPE_ROBOT,V2NIM_MESSAGE_TYPE_TIP,V2NIM_MESSAGE_TYPE_AVCHAT 转发的消息消息必须为发送成功的消息

参数
message需要转发的消息体
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java248 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createImageMessage ( String  imagePath,
String  name,
String  sceneName,
Integer  width,
Integer  height 
)
static

构造图片消息

参数
imagePath图片文件地址
name文件显示名称
sceneName文件存储场景名
width图片文件宽度
height图片文件高度
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java53 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createLocationMessage ( double  latitude,
double  longitude,
String  address 
)
static

构造地理位置消息

参数
latitude纬度
longitude经度
address详细位置信息
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java193 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createTextMessage ( String  text)
static

构造文本消息

参数
text需要发送的文本内容
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java37 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createTipsMessage ( String  text)
static

构造提示消息

参数
text提示内容
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java283 行定义.

static V2NIMChatroomMessage com.netease.nimlib.sdk.v2.chatroom.V2NIMChatroomMessageCreator.createVideoMessage ( String  videoPath,
String  name,
String  sceneName,
Integer  duration,
Integer  width,
Integer  height 
)
static

构造视频消息

参数
videoPath视频文件地址
name视频文件显示名称
sceneName文件存储场景名 自定义场景使用之前, 需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 传空默认使用:V2NIMStorageSceneConfig.DEFAULT_IM
duration视频文件播放长度
width视频文件宽度
height视频文件高度
返回
V2NIMChatroomMessage

在文件 V2NIMChatroomMessageCreator.java126 行定义.


该类的文档由以下文件生成: