IM 消息创建器
更多...
#include <v2_nim_utilities.hpp>
|
static nstd::optional< V2NIMMessage > | createTextMessage (nstd::string text) |
| 创建文本消息
|
|
static nstd::optional< V2NIMMessage > | createImageMessage (nstd::string imagePath, nstd::string name, nstd::string sceneName, uint32_t width, uint32_t height) |
| 创建图片消息
|
|
static nstd::optional< V2NIMMessage > | createAudioMessage (nstd::string audioPath, nstd::string name, nstd::string sceneName, uint32_t duration) |
| 创建音频消息
|
|
static nstd::optional< V2NIMMessage > | createVideoMessage (nstd::string videoPath, nstd::string name, nstd::string sceneName, uint32_t duration, uint32_t width, uint32_t height) |
| 创建视频消息
|
|
static nstd::optional< V2NIMMessage > | createFileMessage (nstd::string filePath, nstd::string name, nstd::string sceneName) |
| 创建文件消息
|
|
static nstd::optional< V2NIMMessage > | createLocationMessage (double latitude, double longitude, nstd::string address) |
| 创建位置消息
|
|
static nstd::optional< V2NIMMessage > | createCustomMessage (nstd::string text, nstd::string rawAttachment) |
| 创建自定义消息
|
|
static nstd::optional< V2NIMMessage > | createTipsMessage (nstd::string text) |
| 创建提示消息
|
|
static nstd::optional< V2NIMMessage > | createForwardMessage (V2NIMMessage message) |
| 创建转发消息
|
|
static nstd::optional< V2NIMMessage > | createCallMessage (int32_t type, const nstd::string &channelId, int32_t status, const nstd::vector< V2NIMMessageCallDuration > &durations, const nstd::string &text) |
| 构造话单消息
|
|
◆ createAudioMessage()
创建音频消息
- 参数
-
audioPath | 音频路径 |
name | 文件显示名称, 为空则使用文件名 |
sceneName | 文件存储场景 |
duration | 音频时长 |
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!audioMessage) {
}
static const char * V2NIM_STORAGE_SCENE_NAME_DEFAULT_IM
Definition: v2_nim_def_enum.hpp:1606
static nstd::optional< V2NIMMessage > createAudioMessage(nstd::string audioPath, nstd::string name, nstd::string sceneName, uint32_t duration)
创建音频消息
Definition: v2_nim_internal.hpp:154
◆ createCallMessage()
构造话单消息
- 参数
-
type | 话单类型,业务自定义,内容不校验 |
channelId | 话单频道 ID,内容不校验 |
status | 通话状态,业务自定义状态,内容不校验 |
durations | 通话成员时长列表,内容不校验 |
text | 话单描述 |
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!callMessage) {
}
static nstd::optional< V2NIMMessage > createCallMessage(int32_t type, const nstd::string &channelId, int32_t status, const nstd::vector< V2NIMMessageCallDuration > &durations, const nstd::string &text)
构造话单消息
Definition: v2_nim_internal.hpp:183
◆ createCustomMessage()
创建自定义消息
- 参数
-
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!customMessage) {
}
static nstd::optional< V2NIMMessage > createCustomMessage(nstd::string text, nstd::string rawAttachment)
创建自定义消息
Definition: v2_nim_internal.hpp:174
◆ createFileMessage()
创建文件消息
- 参数
-
filePath | 文件路径 |
name | 文件显示名称, 为空则使用文件名 |
sceneName | 文件存储场景 |
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!fileMessage) {
}
static nstd::optional< V2NIMMessage > createFileMessage(nstd::string filePath, nstd::string name, nstd::string sceneName)
创建文件消息
Definition: v2_nim_internal.hpp:168
◆ createForwardMessage()
创建转发消息
- 参数
-
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!forwardMessage) {
}
static nstd::optional< V2NIMMessage > createForwardMessage(V2NIMMessage message)
创建转发消息
Definition: v2_nim_internal.hpp:180
◆ createImageMessage()
创建图片消息
- 参数
-
imagePath | 图片路径 |
name | 文件显示名称, 为空则使用文件名 |
sceneName | 文件存储场景 |
width | 图片宽度 |
height | 图片高度 |
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
100); if(!imageMessage) {
}
static nstd::optional< V2NIMMessage > createImageMessage(nstd::string imagePath, nstd::string name, nstd::string sceneName, uint32_t width, uint32_t height)
创建图片消息
Definition: v2_nim_internal.hpp:147
◆ createLocationMessage()
创建位置消息
- 参数
-
latitude | 纬度 |
longitude | 经度 |
address | 详细位置信息 |
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!locationMessage) {
}
static nstd::optional< V2NIMMessage > createLocationMessage(double latitude, double longitude, nstd::string address)
创建位置消息
Definition: v2_nim_internal.hpp:171
◆ createTextMessage()
创建文本消息
- 参数
-
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!textMessage) {
}
static nstd::optional< V2NIMMessage > createTextMessage(nstd::string text)
创建文本消息
Definition: v2_nim_internal.hpp:144
◆ createTipsMessage()
创建提示消息
- 参数
-
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if(!tipMessage) {
}
static nstd::optional< V2NIMMessage > createTipsMessage(nstd::string text)
创建提示消息
Definition: v2_nim_internal.hpp:177
◆ createVideoMessage()
创建视频消息
- 参数
-
videoPath | 视频路径 |
name | 文件显示名称, 为空则使用文件名 |
sceneName | 文件存储场景 |
duration | 视频时长 |
width | 视频宽度 |
height | 视频高度 |
- 返回
- nstd::optional<V2NIMMessage>
- 示例代码
if (!videoMessage) {
}
static nstd::optional< V2NIMMessage > createVideoMessage(nstd::string videoPath, nstd::string name, nstd::string sceneName, uint32_t duration, uint32_t width, uint32_t height)
创建视频消息
Definition: v2_nim_internal.hpp:160
该类的文档由以下文件生成:
- D:/GitLab/builds/7_aFT3sv/0/nim-pc/california/nim-cross-platform-sdk/exports/include/v2_nim_utilities.hpp
- D:/GitLab/builds/7_aFT3sv/0/nim-pc/california/nim-cross-platform-sdk/exports/include/v2_nim_internal.hpp