NIMPassThroughManagerProtocol.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. */
  28. - (void)didReceivedPassThroughMsg:(NIMPassThroughMsgData* __nullable)recvData;
  29. @end
  30. /**
  31. * PassThrough接口
  32. */
  33. @protocol NIMPassThroughManager <NSObject>
  34. /**
  35. * 透传HTTP请求到应用服务
  36. *
  37. * @param reqData 透传的Http数据
  38. * @param completion 经验操作完成后的回调
  39. * @discussion 操作成功后,云信服务器会下发禁言的群通知消息
  40. */
  41. - (void)passThroughHttpReq:(NIMPassThroughHttpData *)reqData
  42. completion:(nullable NIMPassThroughCompletedBlock)completion;
  43. /**
  44. * 添加透传管理的委托
  45. *
  46. * @param delegate 透传管理委托
  47. */
  48. - (void)addDelegate:(id<NIMPassThroughManagerDelegate>)delegate;
  49. /**
  50. * 移除透传管理的委托
  51. *
  52. * @param delegate 透传管理委托
  53. */
  54. - (void)removeDelegate:(id<NIMPassThroughManagerDelegate>)delegate;
  55. @end
  56. NS_ASSUME_NONNULL_END