NIMSDK-iOS
载入中...
搜索中...
未找到
V2NIMChatroomMessageCreator.h
浏览该文件的文档.
1//
2// V2NIMChatroomMessageCreator.h
3// NIMLib
4//
5// Created by Netease on 2023/11/20.
6// Copyright © 2023 Netease. All rights reserved.
7//
8#import <Foundation/Foundation.h>
9
11
12NS_ASSUME_NONNULL_BEGIN
13
14@interface V2NIMChatroomMessageCreator : NSObject
15/// 构造文本消息
16/// @param text 需要发送的文本内容
17+ (V2NIMChatroomMessage *)createTextMessage:(NSString *)text;
18
19/// 创建图片消息
20/// @param imagePath 图片文件路径
21/// @param name 文件显示名称
22/// @param sceneName 场景名 自定义场景使用之前,需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 默认使用DEFAULT_IM对应的场景名
23/// @param width 图片文件宽度
24/// @param width 图片文件高度
25+ (V2NIMChatroomMessage *)createImageMessage:(NSString *)imagePath
26 name:(nullable NSString *)name
27 sceneName:(nullable NSString *)sceneName
28 width:(int)width
29 height:(int)height;
30
31/// 构造语音消息
32/// @param audioPath 语音文件地址
33/// @param name 语音文件显示名称
34/// @param sceneName 场景名 自定义场景使用之前,需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 默认使用DEFAULT_IM对应的场景名
35/// @param duration 语音文件播放长度
36
37+ (V2NIMChatroomMessage *)createAudioMessage:(NSString *)audioPath
38 name:(nullable NSString *)name
39 sceneName:(nullable NSString *)sceneName
40 duration:(int)duration;
41
42
43/// 构造视频消息
44/// @param videoPath 视频文件地址 【必填】
45/// @param name 视频文件显示名称 【选填】
46/// @param sceneName 场景名 自定义场景使用之前,需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 默认使用DEFAULT_IM对应的场景名
47/// @param duration 视频文件播放长度 【必填】
48/// @param width 视频文件宽度 【选填】
49/// @param height 视频文件高度【选填】
50///
51+ (V2NIMChatroomMessage *)createVideoMessage:(NSString *)videoPath
52 name:(nullable NSString *)name
53 sceneName:(nullable NSString *)sceneName
54 duration:(int)duration
55 width:(int)width
56 height:(int)height;
57
58/// 构造文件消息
59/// @param filePath 文件地址 【必填】
60/// @param name 文件显示名称 【选填】
61/// @param sceneName 场景名 自定义场景使用之前,需要先调用V2NIMStorageService.addCustomStorageScene新增自定义场景值 默认使用DEFAULT_IM对应的场景名
62+ (V2NIMChatroomMessage *)createFileMessage:(NSString *)filePath
63 name:(nullable NSString *)name
64 sceneName:(nullable NSString *)sceneName;
65
66/// 构造地理位置消息
67/// @param latitude 纬度 【必填】
68/// @param longitude 经度 【必填】
69/// @param address 详细位置信息 【必填】
70+ (V2NIMChatroomMessage *)createLocationMessage:(double)latitude
71 longitude:(double)longitude
72 address:(NSString *)address;
73
74/// 构造自定义消息消息
75/// @param text 需要发送的文本内容
76/// @param rawAttachment 需要发送的附件
77+ (V2NIMChatroomMessage *)createCustomMessage:(NSString *)rawAttachment;
78
79
80/// 构造转发消息,消息内容与原消息一样
81/// 转发消息类型不能为:
82/// V2NIM_MESSAGE_TYPE_NOTIFICATION,
83/// V2NIM_MESSAGE_TYPE_ROBOT,
84/// V2NIM_MESSAGE_TYPE_TIP,
85/// V2NIM_MESSAGE_TYPE_AVCHAT
86/// 转发的消息消息必须为发送成功的消息
87/// @param message 需要转发的消息体
88+ (V2NIMChatroomMessage *)createForwardMessage:(V2NIMChatroomMessage *)message;
89
90/// 构造提示消息
91/// @param text 提示内容
92+ (V2NIMChatroomMessage *)createTipsMessage:(NSString *)text;
93@end
94
95NS_ASSUME_NONNULL_END
Definition: V2NIMChatroomMessageCreator.h:15
消息对象
Definition: V2NIMChatroomMessage.h:43