NIMPassThroughManagerProtocol.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // NIMPassThroughManagerProtocol.h
  3. // NIMLib
  4. //
  5. // Created by Netease on 2019/12/19.
  6. // Copyright © 2019 Netease. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class NIMPassThroughHttpData;
  10. @class NIMPassThroughMsgData;
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * 透传HTTP请求完成的回调block
  14. * @param response 透传请求的响应,如果错误则为nil
  15. * @param error 错误,如果成功则为nil
  16. */
  17. typedef void(^NIMPassThroughCompletedBlock)(NIMPassThroughHttpData* __nullable response, NSError * __nullable error);
  18. /**
  19. * 透传服务管理回调
  20. */
  21. @protocol NIMPassThroughManagerDelegate <NSObject>
  22. @optional
  23. /**
  24. * 收到透传消息
  25. *
  26. * @param recvData 收到的透传消息数据
  27. * @discussion
  28. */
  29. - (void)didReceivedPassThroughMsg:(NIMPassThroughMsgData* __nullable)recvData;
  30. @end
  31. /**
  32. * PassThrough接口
  33. */
  34. @protocol NIMPassThroughManager <NSObject>
  35. /**
  36. * 透传HTTP请求到应用服务
  37. *
  38. * @param reqData 透传的Http数据
  39. * @param completion 经验操作完成后的回调
  40. * @discussion 操作成功后,云信服务器会下发禁言的群通知消息
  41. */
  42. - (void)passThroughHttpReq:(NIMPassThroughHttpData *)reqData
  43. completion:(nullable NIMPassThroughCompletedBlock)completion;
  44. /**
  45. * 添加透传管理的委托
  46. *
  47. * @param delegate 透传管理委托
  48. */
  49. - (void)addDelegate:(id<NIMPassThroughManagerDelegate>)delegate;
  50. /**
  51. * 移除透传管理的委托
  52. *
  53. * @param delegate 透传管理委托
  54. */
  55. - (void)removeDelegate:(id<NIMPassThroughManagerDelegate>)delegate;
  56. @end
  57. NS_ASSUME_NONNULL_END