NERoomChatController
@objcMembers
public class NERoomChatController : NSObject, NEBaseController
房间聊天控制器
-
功能是否支持
Declaration
Swift
public var isSupported: Bool { get }
-
加入聊天室
Declaration
Swift
public func joinChatroom(callback: NECallback<AnyObject>? = nil)
Parameters
callback
回调闭包
-
加入聊天室
Declaration
Swift
public func joinChatroom(chatroomType: NEChatroomType, callback: NECallback<AnyObject>? = nil)
-
离开聊天室
Declaration
Swift
public func leaveChatroom(_ callback: NECallback<AnyObject>? = nil)
Parameters
callback
回调闭包
-
离开聊天室
Declaration
Swift
public func leaveChatroom(chatroomType: NEChatroomType, callback: NECallback<AnyObject>? = nil)
-
发送广播消息
Declaration
Swift
public func sendBroadcastTextMessage(message: String, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
message
消息内容
callback
回调闭包
-
发送广播消息
Declaration
Swift
public func sendBroadcastTextMessage(message: String, chatroomType: NEChatroomType, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
message
消息内容
chatroomType
聊天室类型
callback
回调闭包
-
发送广播消息
Declaration
Swift
public func sendBroadcastTextMessage(message: String, chatroomType: NEChatroomType, senderExtension: [String: Any]?, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
message
消息内容
chatroomType
聊天室类型
senderExtension
发送者的扩展信息
callback
回调闭包
-
给单人定向发消息
Declaration
Swift
public func sendDirectTextMessage(userUuid: String, message: String, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
userUuid
用户Id
message
消息内容
callback
回调闭包
-
给单人定向发消息
Declaration
Swift
public func sendDirectTextMessage(userUuid: String, message: String, chatroomType: NEChatroomType, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
userUuid
用户Id
message
消息内容
chatRoomType
聊天室类型
callback
回调闭包
-
给单人定向发消息
Declaration
Swift
public func sendDirectTextMessage(userUuid: String, message: String, chatroomType: NEChatroomType, senderExtension: [String: Any]?, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
userUuid
用户Id
message
消息内容
chatRoomType
聊天室类型
senderExtension
发送者的扩展信息
callback
回调闭包
-
给多人发送消息
Declaration
Swift
public func sendGroupTextMessage(userUuids: [String], message: String, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
userUuids
用户Id数组
message
消息内容
callback
回调闭包
-
给多人发送消息
Declaration
Swift
public func sendGroupTextMessage(userUuids: [String], message: String, chatroomType: NEChatroomType, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
userUuids
用户Id数组
message
消息内容
chatRoomType
聊天室类型
callback
回调闭包
-
给多人发送消息
Declaration
Swift
public func sendGroupTextMessage(userUuids: [String], message: String, chatroomType: NEChatroomType, senderExtension: [String: Any]?, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
userUuids
用户Id数组
message
消息内容
chatRoomType
聊天室类型
senderExtension
发送者的扩展信息
callback
回调闭包
-
获取聊天室成员
Declaration
Swift
public func fetchChatroomMembers(type: NEChatroomMemberQueryType, limit: Int, callback: NECallback<[NEChatroomMember]>? = nil)
Parameters
type
查询类型
limit
数量限制
callback
结果回调
-
获取聊天室成员
Declaration
Swift
public func fetchChatroomMembers(type: NEChatroomMemberQueryType, limit: Int, lastMember: String?, callback: NECallback<[NEChatroomMember]>? = nil)
Parameters
type
查询类型
limit
数量限制
lastMember
最后一位成员锚点,不包括此成员。填nil会使用当前服务器最新时间开始查询,即第一页。
callback
结果回调
-
获取聊天室成员
Declaration
Swift
public func fetchChatroomMembers(type: NEChatroomMemberQueryType, limit: Int, chatroomType: NEChatroomType, callback: NECallback<[NEChatroomMember]>? = nil)
Parameters
type
查询类型
limit
数量限制
chatRoomType
聊天室类型
callback
结果回调
-
获取聊天室成员
Declaration
Swift
public func fetchChatroomMembers(type: NEChatroomMemberQueryType, limit: Int, chatroomType: NEChatroomType, lastMember: String?, callback: NECallback<[NEChatroomMember]>? = nil)
Parameters
type
查询类型
limit
数量限制
chatroomType
聊天室类型
lastMember
最后一位成员锚点,不包括此成员。填nil会使用当前服务器最新时间开始查询,即第一页。
callback
结果回调
-
获取聊天室历史消息
Declaration
Swift
public func fetchChatroomHistoryMessages(option: NERoomHistoryMessageSearchOption, callback: NECallback<[NERoomChatMessage]>? = nil)
Parameters
option
获取聊天室历史消息的查询选项
callback
获取聊天室历史消息的回调
-
撤回聊天室消息
Declaration
Swift
public func recallChatroomMessage(messageId: String, messageTime: TimeInterval, callback: NECallback<AnyObject>? = nil)
Parameters
messageId
被撤回的聊天室消息Id
messageTime
被撤回的聊天室消息时间戳
callback
撤回聊天室消息的回调
-
撤回聊天室消息
Declaration
Swift
public func recallChatroomMessage(messageId: String, messageTime: TimeInterval, chatroomType: NEChatroomType, callback: NECallback<AnyObject>? = nil)
Parameters
messageId
被撤回的聊天室消息Id
messageTime
被撤回的聊天室消息时间戳
chatRoomType
聊天室类型
callback
撤回聊天室消息的回调
-
设置成员聊天禁言 @param userUuid 成员id @param duration 禁言时长,单位秒 @param notifyExt 扩展信息 @param callback 回调
Declaration
Swift
public func banMemberChat(userUuid: String, duration: Int, notifyExt: String?, callback: NECallback<AnyObject>? = nil)
-
取消成员聊天禁言 @param userUuid 成员id @param notifyExt 扩展信息 @param callback 回调
Declaration
Swift
public func unbanMemberChat(userUuid: String, notifyExt: String?, callback: NECallback<AnyObject>? = nil)
-
获取聊天室禁言用户列表 @param callback 回调 todo 通过allMembers里面去过滤,不走服务端
Declaration
Swift
public func getChatBannedMembers(callback: NECallback<[NERoomMember]>)
-
发送文件消息
Declaration
Swift
public func sendFileMessage(_ messageUuid: String, filePath: String, userUuids: [String]?, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
messageUuid
消息唯一Id
filePath
文件路径
userUuids
用户Id列表,空为全员消息
callback
回调
-
发送文件消息
Declaration
Swift
public func sendFileMessage(_ messageUuid: String, filePath: String, userUuids: [String]?, chatroomType: NEChatroomType, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
messageUuid
消息唯一Id
filePath
文件路径
userUuids
用户Id列表,空为全员消息
chatroomType
聊天室类型
callback
回调
-
发送图片消息
Declaration
Swift
public func sendImageMessage(_ messageUuid: String, imagePath: String, userUuids: [String]?, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
messageUuid
消息唯一Id
imagePath
文件路径
userUuids
用户id列表,空为全员消息
callback
回调
-
发送图片消息
Declaration
Swift
public func sendImageMessage(_ messageUuid: String, imagePath: String, userUuids: [String]?, chatroomType: NEChatroomType, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
messageUuid
消息唯一Id
imagePath
文件路径
userUuids
用户id列表,空为全员消息
chatroomType
聊天室类型
callback
回调
-
下载文件消息附件
Declaration
Swift
public func downloadAttachment(_ messageUuid: String, callback: NECallback<AnyObject>? = nil)
Parameters
messageUuid
消息唯一Id
thumb
下载缩略图还是原文件 true: 仅下载缩略图。 该参数仅对图片和视频类消息有效。
callback
回调
-
取消下载文件消息附件
Declaration
Swift
public func cancelDownloadAttachment(_ messageUuid: String, callback: NECallback<AnyObject>? = nil)
Parameters
messageUuid
消息唯一Id
callback
回调
-
发送自定义广播消息
Declaration
Swift
public func sendBroadcastCustomMessage(message: String, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
message
消息内容
callback
回调闭包
-
发送自定义广播消息
Declaration
Swift
public func sendBroadcastCustomMessage(message: String, chatroomType: NEChatroomType, callback: NECallback<NERoomChatMessage>? = nil)
Parameters
message
消息内容
chatroomType
聊天室类型
callback
回调闭包