JMessage-iOS-SDK

JMessage-iOS-SDK

HXHG

Jump To… Overview Tasks roomID name appkey desc totalMemberCount maxMemberCount ctime + getChatRoomListWithAppKey:start:count:completionHandler: + getMyChatRoomListCompletionHandler: + getChatRoomInfosWithRoomIds:completionHandler: + enterChatRoomWithRoomId:completionHandler: + leaveChatRoomWithRoomId:completionHandler: - getChatRoomOwnerInfo: - chatRoomBlacklist: - addBlacklistWithUsernames:appKey:handler: - deleteBlacklistWithUsernames:appKey:handler: - chatRoomAdminList: - addAdminWithUsernames:appKey:handler: - deleteAdminWithUsernames:appKey:handler: - addChatRoomSilenceWithTime:usernames:appKey:handler: - deleteChatRoomSilenceWithUsernames:appKey:handler: - getChatRoomMemberSilenceWithUsername:appKey:handler: - getChatRoomSilencesWithStart:count:handler: - displayName

# JMSGChatRoom Class Reference
Inherits from NSObject
Declared in JMSGChatRoom.h
## Overview - 聊天室 - #### 主要特点 - 聊天室的消息没有推送通知和离线保存,也没有常驻成员的概念,只要进入聊天室即可接收消息,开始聊天, 一旦退出聊天室,不再会接收到任何消息、通知和提醒。 - #### 发送消息 - 聊天室消息的发送与单聊、群聊是一样的,通用的发送接口 - #### 接收消息 - 聊天室消息的接收与单聊、群聊做了区分,聊天室消息的接收将通过 JMSGConversationDelegate 类里的 onReceiveChatRoomConversation:messages: 方法通知到上层 ## Other Methods ### + getChatRoomListWithAppKey:start:count:completionHandler: 分页获取聊天室详情 + (void)getChatRoomListWithAppKey:(NSString \JMSG_NULLABLE)appKey start:(NSInteger)start count:(NSInteger)count completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
appKey 选填,为 nil 则获取当前应用下的聊天室
start 分页获取的下标,第一页从 index = 0 开始
count 一页的数量,每页最大值是 50
handler 结果回调. 正常返回时 resultObject 类型是 NSArray
#### Discussion 该接口总是向服务器端发起请求. #### Declared In JMSGChatRoom.h ### + getMyChatRoomListCompletionHandler: 获取当前用户已加入的聊天室列表 + (void)getMyChatRoomListCompletionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
handler 结果回调. 正常返回时 resultObject 类型是 NSArray
#### Discussion 该接口总是向服务器端发起请求. #### Declared In JMSGChatRoom.h ### + getChatRoomInfosWithRoomIds:completionHandler: 获取聊天室详情 + (void)getChatRoomInfosWithRoomIds:(NSArray *JMSG_NONNULL)roomIds completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
roomIds 待获取详情的聊天室 ID 数组
handler 结果回调. 正常返回时 resultObject 类型是 NSArray
#### Discussion 该接口总是向服务器端发起请求. #### Declared In JMSGChatRoom.h ### + enterChatRoomWithRoomId:completionHandler: 加入聊天室 + (void)enterChatRoomWithRoomId:(NSString *JMSG_NONNULL)roomId completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
roomId 聊天室 id
handler 结果回调. error = nil 表示加入成功,resultObject 为 JMSGConversation 类型
#### Discussion 成功进入聊天室之后,会将聊天室中最近若干条聊天记录同步下来并以 onReceiveChatRoomConversation: 事件的形式通知到上层,进入聊天室会自动获取最近50条消息。 #### Declared In JMSGChatRoom.h ### + leaveChatRoomWithRoomId:completionHandler: 退出聊天室 + (void)leaveChatRoomWithRoomId:(NSString *JMSG_NONNULL)roomId completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
roomId 聊天室 id
handler 结果回调. error = nil 表示加入成功.
#### Discussion 退出聊天室后获取不到任何消息和通知. #### Declared In JMSGChatRoom.h ## Group basic fields 群组基本属性 ### roomID 聊天室 id @property (nonatomic, strong, readonly) NSString *roomID #### Declared In JMSGChatRoom.h ### name 名称 @property (nonatomic, strong, readonly) NSString *name #### Declared In JMSGChatRoom.h ### appkey 聊天室所属应用 AppKey @property (nonatomic, strong, readonly) NSString *appkey #### Declared In JMSGChatRoom.h ### desc 描述信息 @property (nonatomic, strong, readonly) NSString *desc #### Declared In JMSGChatRoom.h ### totalMemberCount 聊天室人数 @property (nonatomic, assign, readonly) NSInteger totalMemberCount #### Declared In JMSGChatRoom.h ### maxMemberCount 聊天室最大人数限制 @property (nonatomic, strong, readonly) NSString *maxMemberCount #### Declared In JMSGChatRoom.h ### ctime 聊天室的创建时间 @property (nonatomic, strong, readonly) NSNumber *ctime #### Declared In JMSGChatRoom.h ### – getChatRoomOwnerInfo: 聊天室创建者 - (void)getChatRoomOwnerInfo:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
handler 结果回调. error = nil 表示获取成功, resultObject 为 JMSGUser 类型.
#### Declared In JMSGChatRoom.h ### – chatRoomBlacklist: 聊天室的黑名单列表 - (void)chatRoomBlacklist:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
handler 结果回调. resultObject 是 NSArray 类型,元素是 JMSGUser
#### Availability 3.8.0 #### Declared In JMSGChatRoom.h ### – addBlacklistWithUsernames:appKey:handler: 添加黑名单 - (void)addBlacklistWithUsernames:(NSArray<__kindofNSString*> *)usernames appKey:(NSString *JMSG_NULLABLE)appKey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
usernames 用户名列表
appKey 用户 appKey,usernames 中的所有用户必须在同一个 AppKey 下,不填则默认为本应用 appKey
handler 结果回调。error 为 nil 表示成功.
#### Availability 3.8.0 #### Declared In JMSGChatRoom.h ### – deleteBlacklistWithUsernames:appKey:handler: 删除黑名单 - (void)deleteBlacklistWithUsernames:(NSArray<__kindofNSString*> *)usernames appKey:(NSString *JMSG_NULLABLE)appKey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
usernames 用户名列表
appKey 用户 appKey,usernames 中的所有用户必须在同一个 AppKey 下,不填则默认为本应用 appKey
handler 结果回调。error 为 nil 表示成功.
#### Availability 3.8.0 #### Declared In JMSGChatRoom.h ### – chatRoomAdminList: 管理员列表 - (void)chatRoomAdminList:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
handler 结果回调. resultObject 是 NSArray 类型,元素是 JMSGUser
#### Availability 3.8.0 #### Discussion 注意:返回列表中不包含房主. #### Declared In JMSGChatRoom.h ### – addAdminWithUsernames:appKey:handler: 添加管理员 - (void)addAdminWithUsernames:(NSArray<__kindofNSString*> *)usernames appKey:(NSString *JMSG_NULLABLE)appkey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
usernames 用户名列表
appkey 用户 AppKey,不填则默认为本应用 AppKey
handler 结果回调。error 为 nil 表示成功.
#### Availability 3.8.0 #### Discussion 注意:非 VIP 应用最多设置 15 个管理员,不包括群主本身 #### Declared In JMSGChatRoom.h ### – deleteAdminWithUsernames:appKey:handler: 删除管理员 - (void)deleteAdminWithUsernames:(NSArray<__kindofNSString*> *)usernames appKey:(NSString *JMSG_NULLABLE)appkey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
usernames 用户名列表
appkey 用户 AppKey,不填则默认为本应用 AppKey
handler 结果回调。error 为 nil 表示成功.
#### Availability 3.8.0 #### Declared In JMSGChatRoom.h ### – addChatRoomSilenceWithTime:usernames:appKey:handler: 设置成员禁言(可设置禁言时间) - (void)addChatRoomSilenceWithTime:(SInt64)silenceTime usernames:(NSArray *JMSG_NONNULL)usernames appKey:(NSString *JMSG_NULLABLE)appkey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
silenceTime 禁言时间戳,单位:毫秒,必须不小于5分钟,不大于1年
usernames 用户的 username 数组,一次最多500人
appkey 用户的 appKey,若传入空则默认使用本应用appKey,同一次设置的 usernames 必须在同一个 AppKey 下
handler 结果回调,error = nil 时,表示成功
#### Availability 3.8.1 #### Discussion 只有房主和管理员可设置;设置成功的话上层会收到相应下发事件。 #### Declared In JMSGChatRoom.h ### – deleteChatRoomSilenceWithUsernames:appKey:handler: 取消成员禁言 - (void)deleteChatRoomSilenceWithUsernames:(NSArray *JMSG_NONNULL)usernames appKey:(NSString *JMSG_NULLABLE)appkey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
usernames 用户的 username 数组,一次最多500人
appkey 用户的 appKey,若传入空则默认使用本应用appKey,同一次设置的 usernames 必须在同一个 AppKey 下
handler 结果回调,error = nil 时,表示成功
#### Availability 3.8.1 #### Discussion 只有房主和管理员可设置;取消成功的话上层会收到相应下发事件。 #### Declared In JMSGChatRoom.h ### – getChatRoomMemberSilenceWithUsername:appKey:handler: 获取禁言状态 - (void)getChatRoomMemberSilenceWithUsername:(NSString *JMSG_NONNULL)username appKey:(NSString *JMSG_NULLABLE)appKey handler:(JMSGCompletionHandler JMSG_NULLABLE)handler #### Parameters
username 用户名
appKey 用户所在应用 AppKey,不填这默认本应用
handler 结果回调,resultObject 是 JMSGMemberSilenceInfo 类型 若 error == nil && resultObject != nil,该成员已被禁言 若 error == nil && resultObject == nil,该成员未被禁言 若 error != nil ,请求失败,
#### Availability 3.8.1 #### Discussion 详细信息可查看 JMSGMemberSilenceInfo 类 #### Declared In JMSGChatRoom.h ### – getChatRoomSilencesWithStart:count:handler: 禁言列表 - (void)getChatRoomSilencesWithStart:(SInt64)start count:(SInt64)count handler:(void ( ^ ) ( NSArray<__kindofJMSGMemberSilenceInfo*> *JMSG_NULLABLE list , SInt64 total , NSError *JMSG_NULLABLE error ))handler #### Parameters
start 开始位置
count 需要获取的个数,必须大于 0
handler 结果回调
#### Availability 3.8.1 #### Declared In JMSGChatRoom.h ### – displayName 聊天室的展示名 - (NSString *)displayName #### Discussion 如果 chatroom.name 为空, 则此接口会返回 chatroom.roomID. #### Declared In JMSGChatRoom.h

Copyright © 2019 HXHG. All rights reserved. Updated: 2019-05-06

Generated by appledoc 2.2.1 (build 1334).

若有收获,就点个赞吧

0 人点赞

暂无相关搜索结果!
    展开/收起文章目录