EMCmdMessageBody.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * \~chinese
  3. * @header EMCmdMessageBody.h
  4. * @abstract 命令消息体对象。
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMCmdMessageBody.h
  10. * @abstract The command message body object.
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMMessageBody.h"
  16. /**
  17. * \~chinese
  18. * 命令消息体对象。
  19. *
  20. * \~english
  21. * The command message body.
  22. */
  23. @interface EMCmdMessageBody : EMMessageBody
  24. /**
  25. * \~chinese
  26. * 命令内容。
  27. *
  28. * \~english
  29. * The command content.
  30. */
  31. @property (nonatomic, copy) NSString *action;
  32. /**
  33. * \~chinese
  34. * 是否只投递在线用户。默认为否,同时投递给在线和离线用户;设置为 YES 则只投递在线用户。
  35. * 一般来说,用户不在线时有需要接收的消息,服务器会把消息放到离线队列,等用户上线后,再由 SDK 从离线队列中把消息拉走,对用户来说就是“收到了离线期间的消息”。但针对设置了 `isDeliverOnlineOnly` 的 cmd 消息,服务器不会写到离线队列,这样用户再上线后就不会取到了,从而达到 “只投递在线” 的效果。
  36. *
  37. * \~english
  38. * Whether this cmd msg is delivered to the online users only. The default value is NO. Set this parameter as YES and the msg is delivered to the online users only, so the offline users won't receive the msg when they log in later.
  39. */
  40. @property (nonatomic) BOOL isDeliverOnlineOnly;
  41. /**
  42. * \~chinese
  43. * 初始化命令消息体。
  44. * `EMMessage` 的 `ext` 属性是用户自己定义的关键字,接收后,解析出自定义的字符串,可以自行处理。
  45. *
  46. * @param aAction 命令内容。
  47. *
  48. * @result 命令消息体实例。
  49. *
  50. * \~english
  51. * The construct command message body.
  52. * Developer self-defined command string that can be used for specifing custom action/command. See `ext` in `EMMessage`.
  53. *
  54. * @param aAction The self-defined command string content.
  55. *
  56. * @result The instance of command message body.
  57. */
  58. - (instancetype _Nonnull)initWithAction:(NSString * _Nonnull)aAction;
  59. @end