XYChatRTMManager.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // XYChatRTMManager.h
  3. // Timi
  4. //
  5. // Created by 翟玉磊 on 2021/3/25.
  6. // 聊天室RTM管理
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @protocol XYChatRTMManagerDelegate <NSObject>
  10. - (void)im_onReceivedChatRoomMessage:(NSDictionary *)message;
  11. - (void)im_onReceivedChatRoomMessages:(NSArray *)messages offline:(BOOL)offline;
  12. @end
  13. @interface XYChatRTMManager : NSObject
  14. @property (nonatomic, weak) id<XYChatRTMManagerDelegate>delegate;
  15. /// 本地头条历史消息
  16. @property (nonatomic, strong) NSMutableArray *headlineTextMessages;
  17. + (instancetype)sharedInstance;
  18. - (void)im_joinChatRoom:(NSString *)roomId timestamp:(NSString *)timestamp complete:(void(^)(BOOL success))block;
  19. - (void)im_quitChatRoom:(NSString *)roomId complete:(void(^)(BOOL success))block;
  20. - (void)im_sendMessageWithRoomId:(NSString *)roomId content:(NSDictionary *)msgDict complete:(void(^)(BOOL success, NSInteger errorCode, NSString *msg))block;
  21. - (void)im_onReceived:(id)message left:(int)nLeft;
  22. - (void)im_reset;
  23. /// 获取聊天室属性
  24. - (void)getAllChatRoomEntriesWithRoomId:(NSString *)roomId block:(void(^)(NSDictionary *entry))block;
  25. - (void )pkClear;
  26. @end
  27. NS_ASSUME_NONNULL_END