NIMSDK-iOS
载入中...
搜索中...
未找到
<NIMQChatMessageManager>协议 参考

#import <NIMQChatMessageManagerProtocol.h>

类 <NIMQChatMessageManager> 继承关系图:

构造函数

(BOOL) - sendMessage:toSession:error:
 
(void) - sendMessage:toSession:completion:
 
(BOOL) - cancelSendingMessage:
 
(BOOL) - resendMessage:error:
 
(nullable NIMQChatMessage *) - makeForwardMessage:error:
 
(BOOL) - sendForwardMessage:toSession:error:
 
(BOOL) - forwardMessage:toSession:error:
 
(BOOL) - messageInTransport:
 
(float) - messageTransportProgress:
 
(BOOL) - fetchMessageAttachment:error:
 
(void) - cancelFetchingMessageAttachment:
 
(void) - updateMessage:completion:
 
(void) - revokeMessage:completion:
 
(void) - deleteMessage:completion:
 
(void) - markMessageRead:completion:
 
(void) - getMessageHistory:completion:
 
(void) - getMessageHistoryByIds:completion:
 
(void) - sendSystemNotification:completion:
 
(void) - resendSystemNotification:completion:
 
(void) - updateSystemNotification:completion:
 
(void) - markSystemNotificationsRead:completion:
 
(void) - sendMessageTypingEvent:completion:
 
(void) - getMessageCache:completion:
 
(void) - getLastMessageOfChannels:completion:
 
(void) - searchMsgByPage:completion:
 
(void) - getMentionedMeMessages:completion:
 
(void) - areMentionedMeMessages:completion:
 
(void) - clearMessageCache
 
(BOOL) - insertOrReplaceTextCache:channelId:value:
 
(BOOL) - deleteTextCache:channelId:
 
(nullable NSString *) - getTextCache:channelId:
 
(void) - addDelegate:
 
(void) - removeDelegate:
 

详细描述

圈组消息管理器

函数文档

◆ addDelegate:

- (void) addDelegate: (id< NIMQChatMessageManagerDelegate >)  delegate

添加通知对象

参数
delegate通知对象

◆ areMentionedMeMessages:completion:

- (void) areMentionedMeMessages: (NIMQChatAreMentionedMeMessagesParam *)  param
completion: (nullable NIMQChatAreMentionedMeMessagesHandler completion 

批量查询消息是否 @ 当前用户

参数
param传入参数
completion结果回调

◆ cancelFetchingMessageAttachment:

- (void) cancelFetchingMessageAttachment: (NIMQChatMessage *)  message

取消收取消息附件

参数
message需要取消收取附件的消息

@discussion 附件包括:图片消息的图片缩略图,视频消息的视频缩略图,音频消息的音频文件,文件消息的文件以及自定义消息中的自定义文件

◆ cancelSendingMessage:

- (BOOL) cancelSendingMessage: (NIMQChatMessage *)  message

取消正在发送的消息

参数
message目标消息
返回
是否调用成功

◆ clearMessageCache

- (void) clearMessageCache

清理消息本地缓存

◆ deleteMessage:completion:

- (void) deleteMessage: (NIMQChatDeleteMessageParam *)  param
completion: (nullable NIMQChatUpdateMessageHandler completion 

删除圈组消息 @discussion

参数
param传入参数
completion结果回调

◆ deleteTextCache:channelId:

- (BOOL) deleteTextCache: (unsigned long long)  serverId
channelId: (unsigned long long)  channelId 

删除缓存数据。 serverId > 0 && channelId > 0:删除指定频道的数据 serverId > 0 && channelId == 0:删除指定服务器下所有频道的数据 serverId == 0 && channelId > 0:删除指定频道ID的数据 serverId == 0 && channelId == 0:清空数据

参数
serverId服务器ID,大于等于0
channelId频道ID,大于等于0
返回
YES:完成删除操作,包括数据存在的删除和数据不存在的删除;NO:其它

◆ fetchMessageAttachment:error:

- (BOOL) fetchMessageAttachment: (NIMQChatMessage *)  message
error: (NSError *__nullable *)  error 

收取消息附件

参数
message需要收取附件的消息
error错误
返回
是否调用成功 @discussion 附件包括:图片消息的图片缩略图,视频消息的视频缩略图,音频消息的音频文件,文件消息的文件以及自定义消息中的自定义文件

◆ forwardMessage:toSession:error:

- (BOOL) forwardMessage: (NIMQChatMessage *)  message
toSession: (NIMSession *)  session
error: (NSError *__nullable *)  error 

转发消息

参数
message消息
session接收方
error错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
返回
是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器

◆ getLastMessageOfChannels:completion:

- (void) getLastMessageOfChannels: (NIMQChatGetLastMessageOfChannelsParam *)  param
completion: (nullable NIMQChatGetLastMessageOfChannelsHandler completion 

批量查询频道最后一条消息

参数
param传入参数
completion结果回调

◆ getMentionedMeMessages:completion:

- (void) getMentionedMeMessages: (NIMQChatGetMentionedMeMessagesParam *)  param
completion: (nullable NIMQChatGetMentionedMeMessagesHandler completion 

搜索圈组 @ 我的消息

参数
param传入参数
completion结果回调

◆ getMessageCache:completion:

- (void) getMessageCache: (NIMQChatGetMessageCacheParam *)  param
completion: (nullable NIMQChatGetMessageCacheHandler completion 

从本地缓存查询消息

参数
param传入参数
completion结果回调

◆ getMessageHistory:completion:

- (void) getMessageHistory: (NIMQChatGetMessageHistoryParam *)  param
completion: (nullable NIMQChatGetMessageHistoryHandler completion 

从服务端查询历史消息

参数
param传入参数
completion结果回调

◆ getMessageHistoryByIds:completion:

- (void) getMessageHistoryByIds: (NIMQChatGetMessageHistoryByIdsParam *)  param
completion: (nullable NIMQChatGetMessageHistoryHandler completion 

从服务端按ID查询历史消息

参数
param传入参数
completion结果回调

◆ getTextCache:channelId:

- (nullable NSString *) getTextCache: (unsigned long long)  serverId
channelId: (unsigned long long)  channelId 

查询指定频道的缓存数据。

参数
serverId
channelId
返回

◆ insertOrReplaceTextCache:channelId:value:

- (BOOL) insertOrReplaceTextCache: (unsigned long long)  serverId
channelId: (unsigned long long)  channelId
value: (NSString *)  value 

增加一条缓存数据,如果该频道下已经存在数据,则被新数据覆盖。

参数
serverId服务器ID,大于0
channelId频道ID,大于0
text要增加的内容,不能是空指针
返回
YES:成功添加或者替换;NO:其它

◆ makeForwardMessage:error:

- (nullable NIMQChatMessage *) makeForwardMessage: (NIMQChatMessage *)  message
error: (NSError *__nullable *)  error 

生成转发消息 得到转发消息后,开发者需自己再调用sendForwardMessage:toSession:error: 进行发送, 和 直接调用forwardMessage:toSession:error:效果一样,但是这样可以得到转发消息的进度方法回调和是否转发成功方法回调

参数
message要转发的消息
error错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
返回
生成的需要转发的消息

◆ markMessageRead:completion:

- (void) markMessageRead: (NIMQChatMarkMessageReadParam *)  param
completion: (nullable NIMQChatHandler completion 

标记消息已读

参数
param传入参数
completion结果回调

◆ markSystemNotificationsRead:completion:

- (void) markSystemNotificationsRead: (NIMQChatMarkSystemNotificationsReadParam *)  param
completion: (nullable NIMQChatHandler completion 

标记系统通知已读

参数
param传入参数
completion结果回调

◆ messageInTransport:

- (BOOL) messageInTransport: (NIMQChatMessage *)  message

消息是否正在传输 (发送/接受附件)

参数
message消息
返回
是否正在传输

◆ messageTransportProgress:

- (float) messageTransportProgress: (NIMQChatMessage *)  message

传输消息的进度 (发送/接受附件)

参数
message消息
返回
正在传输的消息进度,如果消息不在传输,则返回0

◆ removeDelegate:

- (void) removeDelegate: (id< NIMQChatMessageManagerDelegate >)  delegate

移除通知对象

参数
delegate通知对象

◆ resendMessage:error:

- (BOOL) resendMessage: (NIMQChatMessage *)  message
error: (NSError *__nullable *)  error 

重发消息

参数
message重发消息
error错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
返回
是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器

◆ resendSystemNotification:completion:

- (void) resendSystemNotification: (NIMQChatResendSystemNotificationParam *)  param
completion: (nullable NIMQChatSendSystemNotificationHandler completion 

重发自定义系统通知

参数
param传入参数
completion结果回调

◆ revokeMessage:completion:

- (void) revokeMessage: (NIMQChatRevokeMessageParam *)  param
completion: (nullable NIMQChatUpdateMessageHandler completion 

撤回圈组消息 @discussion

参数
param传入参数
completion结果回调

◆ searchMsgByPage:completion:

- (void) searchMsgByPage: (NIMQChatSearchMsgByPageParam *)  param
completion: (nullable NIMQChatSearchMsgByPageHandler completion 

搜索圈组消息

参数
param传入参数
completion结果回调

◆ sendForwardMessage:toSession:error:

- (BOOL) sendForwardMessage: (NIMQChatMessage *)  message
toSession: (NIMSession *)  session
error: (NSError *__nullable *)  error 

发送生成的转发消息

参数
message转发的消息
session接受方
error错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
返回
是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器

◆ sendMessage:toSession:completion:

- (void) sendMessage: (NIMQChatMessage *)  message
toSession: (NIMSession *)  session
completion: (nullable NIMQChatHandler completion 

异步发送消息

参数
message消息
session接收方
completion发送完成后的回调,这里的回调完成只表示当前这个函数调用完成,需要后续的回调才能判断消息是否已经发送至服务器

◆ sendMessage:toSession:error:

- (BOOL) sendMessage: (NIMQChatMessage *)  message
toSession: (NIMSession *)  session
error: (NSError *__nullable *)  error 

发送消息

参数
message消息
session接受方
error错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
返回
是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器

◆ sendMessageTypingEvent:completion:

- (void) sendMessageTypingEvent: (NIMQChatMessageTypingEvent *)  param
completion: (nullable NIMQChatSendMessageTypingEventHandler completion 

发送正在输入等自定义事件

参数
param传入参数
completion结果回调

◆ sendSystemNotification:completion:

- (void) sendSystemNotification: (NIMQChatSendSystemNotificationParam *)  param
completion: (nullable NIMQChatSendSystemNotificationHandler completion 

发送自定义系统通知

参数
param传入参数
completion结果回调

◆ updateMessage:completion:

- (void) updateMessage: (NIMQChatUpdateMessageParam *)  param
completion: (nullable NIMQChatUpdateMessageHandler completion 

更新圈组消息 @discussion 支持文本,服务器扩展,自定义消息状态

参数
param传入参数
completion结果回调

◆ updateSystemNotification:completion:

- (void) updateSystemNotification: (NIMQChatUpdateSystemNotificationParam *)  param
completion: (nullable NIMQChatUpdateSystemNotificationHandler completion 

更新系统通知(可以更新状态、也可以更新内容)


该协议的文档由以下文件生成: