didJoinRoomSuccess加入房间成功
- (void)didJoinRoomSuccess:(BRTMRoom *)room;
参数
返回
didJoinRoomSuccess加入房间失败
- (void)didJoinRoomFailure:(BRTMRoom *)room error:(BRTMError *)error;
willLeaveRoom即将离开房间的通知
- (void)willLeaveRoom:(BRTMRoom *)room error:(nullable BRTMError *)error;
didLeaveRoom离开房间的通知
- (void)didLeaveRoom:(BRTMRoom *)room error:(nullable BRTMError *)error;
documentServiceIsEnable房间内的 document 服务是否可用
- (void)room:(BRTMRoom *)room documentServiceIsEnable:(BOOL)enable senderByUserID:(nullable NSString *)userID;
delegate进入房间相关的代理
@property (nonatomic, weak) id <BRTMDelegate> delegate;
messageDelegate消息相关的代理. note: 区别于 chat
@property (nonatomic, weak) id <BRTMMessageDelegate> messageDelegate;
userManager用户相关, 详细参阅 BRTMUserManager.h
@property (nonatomic, readonly, nullable) BRTMUserManager *userManager;
chatManager聊天相关, 详细参阅 BRTMChatManager.h
@property (nonatomic, readonly, nullable) BRTMChatManager *chatManager;
documentManager聊天相关, 详细参阅 BRTMChatManager.h
@property (nonatomic, readonly, nullable) BRTMDocumentManager *documentManager;
setAppID设置appID
+ (void)setAppID:(NSString *)appID;
createRoom创建一个room
+ (nullable instancetype)createRoom;
joinRoomWithConfig进入房间
- (nullable BRTMError *)joinRoomWithConfig:(BRTMConfig *)config;
setReloadingBlock网络连接断开时回调
- (void)setReloadingBlock:(void (^ _Nullable)(BRTMLoadingVM *reloadingVM, void (^callback)(BOOL reload)))reloadingBlock;
异常退出
reloadingVM
sendBroadcastMessageWithKey发送自定义广播信令,通过'messageDelegate' 的 'room:didReceiveBoardcastMessageWithKey:value:' 监听
- (nullable BRTMError *)sendBroadcastMessageWithKey:(NSString *)key value:(id)value cache:(BOOL)cache;
requestBroadcastMessageCacheWithKey请求自定义广播的缓存,通过'messageDelegate' 的 'room:didReceiveBoardcastMessageWithKey:value:' 监听
- (nullable BRTMError *)requestBroadcastMessageCacheWithKey:(NSString *)key;
sendMessageWithKey请求自定义广播的缓存, 通过'messageDelegate' 的 'room:didReceiveMessageWithKey:value:fromUserID:' 监听
- (nullable BRTMError *)sendMessageWithKey:(NSString *)key value:(id _Nullable)value toUserWithUserID:(NSString *)userID;
enabelDocumentService启用文档服务
void enabelDocumentService()
disableDocumentService禁用文档服务
void disableDocumentService()
createDocumentManager实例化 BRTMDocumentManager, 调用此方法后 documentAdatper 才有值
void createDocumentManager()
destoryDocumentManager销毁 BRTMDocumentManager 实例
void destoryDocumentManager()
iOS
BRTMDelegate代理回调
didJoinRoomSuccess
加入房间成功
参数
返回
didJoinRoomSuccess
加入房间失败
参数
返回
willLeaveRoom
即将离开房间的通知
参数
返回
didLeaveRoom
离开房间的通知
参数
返回
documentServiceIsEnable
房间内的 document 服务是否可用
参数
返回
BRTMRoom类
BRTMRoom类成员变量
delegate
进入房间相关的代理
messageDelegate
消息相关的代理. note: 区别于 chat
userManager
用户相关, 详细参阅 BRTMUserManager.h
chatManager
聊天相关, 详细参阅 BRTMChatManager.h
documentManager
聊天相关, 详细参阅 BRTMChatManager.h
BRTMRoom类函数定义
setAppID
设置appID
参数
返回
createRoom
创建一个room
参数
返回
joinRoomWithConfig
进入房间
参数
返回
setReloadingBlock
网络连接断开时回调
参数
异常退出
; 网络连接断开时回调,回调 callback 确认是否重连,YES 重连、NO 退出教室,也可延时或者手动调用 callback ; 可通过reloadingVM
监听重连的进度和结果; 默认(不设置此回调)在断开时自动重连、重连过程中遇到错误将异常退出
; !!!: 断开重连过程中 vm 的状态、数据没有与服务端同步,调用其它 vm 方法时发起的网络请求会被丢弃、甚至产生不可预期的错误返回
sendBroadcastMessageWithKey
发送自定义广播信令,通过'messageDelegate' 的 'room:didReceiveBoardcastMessageWithKey:value:' 监听
参数
返回
requestBroadcastMessageCacheWithKey
请求自定义广播的缓存,通过'messageDelegate' 的 'room:didReceiveBoardcastMessageWithKey:value:' 监听
参数
返回
sendMessageWithKey
请求自定义广播的缓存, 通过'messageDelegate' 的 'room:didReceiveMessageWithKey:value:fromUserID:' 监听
参数
返回
enabelDocumentService
启用文档服务
参数
返回
disableDocumentService
禁用文档服务
参数
返回
createDocumentManager
实例化 BRTMDocumentManager, 调用此方法后 documentAdatper 才有值
参数
返回
destoryDocumentManager
销毁 BRTMDocumentManager 实例
参数
返回