TIMManager+MsgExt.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // TIMManager+MsgExt.h
  3. // IMMessageExt
  4. //
  5. // Created by tomzhu on 2017/1/11.
  6. //
  7. //
  8. #ifndef TIMManager_MsgExt_h
  9. #define TIMManager_MsgExt_h
  10. #import <ImSDK/ImSDK.h>
  11. #import "TIMComm+MsgExt.h"
  12. @class TIMMessage;
  13. @interface TIMManager (MsgExt)
  14. /**
  15. * 发送消息给多个用户
  16. *
  17. * @param msg 发送的消息
  18. * @param users 目标用户的id列表
  19. * @param succ 成功回调
  20. * @param fail 失败回调
  21. *
  22. * @return 0 发送成功
  23. */
  24. - (int)sendMessage:(TIMMessage*)msg toUsers:(NSArray*)users succ:(TIMSucc)succ fail:(TIMSendToUsersFail)fail;
  25. /**
  26. * 获取会话(TIMConversation*)列表
  27. *
  28. * @return 会话列表
  29. */
  30. - (NSArray*)getConversationList;
  31. /**
  32. * 删除会话
  33. *
  34. * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊
  35. * @param receiver 用户identifier 或者 群组Id
  36. *
  37. * @return TRUE:删除成功 FALSE:删除失败
  38. */
  39. - (BOOL)deleteConversation:(TIMConversationType)type receiver:(NSString*)receiver;
  40. /**
  41. * 删除会话和消息
  42. *
  43. * @param type 会话类型,TIM_C2C 表示单聊 TIM_GROUP 表示群聊
  44. * @param receiver 用户identifier 或者 群组Id
  45. *
  46. * @return TRUE:删除成功 FALSE:删除失败
  47. */
  48. - (BOOL)deleteConversationAndMessages:(TIMConversationType)type receiver:(NSString*)receiver;
  49. /**
  50. * 获取会话数量
  51. *
  52. * @return 会话数量
  53. */
  54. - (int)conversationCount;
  55. /**
  56. * 初始化存储,仅查看历史消息时使用,如果要收发消息等操作,如login成功,不需要调用此函数
  57. *
  58. * @param param 登陆参数(userSig 不用填写)
  59. * @param succ 成功回调,收到回调时,可以获取会话列表和消息
  60. * @param fail 失败回调
  61. *
  62. * @return 0 请求成功
  63. */
  64. - (int)initStorage:(TIMLoginParam*)param succ:(TIMLoginSucc)succ fail:(TIMFail)fail;
  65. @end
  66. #endif /* TIMManager_MsgExt_h */