GTThirdNotification.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. class GTThirdNotification extends GTApiRequest
  3. {
  4. const CLICK_TYPE_INTENT = "intent";
  5. const CLICK_TYPE_URL = "url";
  6. const CLICK_TYPE_PAYLOAD = "payload";
  7. const CLICK_TYPE_STAERAPP = "startapp";
  8. const CLICK_TYPE_NONE = "none";
  9. /**
  10. * 第三方厂商通知标题,长度 ≤ 50
  11. */
  12. private $title;
  13. /**
  14. * 第三方厂商通知内容,长度 ≤ 256
  15. */
  16. private $body;
  17. /**
  18. * @see com.gt.sdk.dto.CommonEnum.ClickTypeEnum
  19. * 点击通知后续动作,
  20. * 目前支持5种后续动作,
  21. * intent:打开应用内特定页面,
  22. * url:打开网页地址,
  23. * payload:启动应用加自定义消息内容,
  24. * startapp:打开应用首页,
  25. * none:纯通知,无后续动作
  26. */
  27. private $clickType;
  28. /**
  29. * 点击通知打开应用特定页面,长度 ≤ 2048;
  30. * 示例:intent:#Intent;component=你的包名/你要打开的 activity 全路径;S.parm1=value1;S.parm2=value2;end
  31. */
  32. private $intent;
  33. /**
  34. * 点击通知打开链接,长度 ≤ 1024
  35. */
  36. private $url;
  37. /**
  38. * 点击通知加自定义消息,长度 ≤ 3072
  39. */
  40. private $payload;
  41. /**
  42. * 消息覆盖使用,两条消息的notify_id相同,新的消息会覆盖老的消息
  43. */
  44. private $notifyId;
  45. public function getTitle()
  46. {
  47. return $this->title;
  48. }
  49. public function setTitle($title)
  50. {
  51. $this->title = $title;
  52. $this->apiParam["title"] = $title;
  53. }
  54. public function getBody()
  55. {
  56. return $this->body;
  57. }
  58. public function setBody($body)
  59. {
  60. $this->body = $body;
  61. $this->apiParam["body"] = $body;
  62. }
  63. public function getClickType()
  64. {
  65. return $this->clickType;
  66. }
  67. public function setClickType($clickType)
  68. {
  69. $this->clickType = $clickType;
  70. $this->apiParam["click_type"] = $clickType;
  71. }
  72. public function getIntent()
  73. {
  74. return $this->intent;
  75. }
  76. public function setIntent($intent)
  77. {
  78. $this->intent = $intent;
  79. $this->apiParam["intent"] = $intent;
  80. }
  81. public function getUrl()
  82. {
  83. return $this->url;
  84. }
  85. public function setUrl($url)
  86. {
  87. $this->url = $url;
  88. $this->apiParam["url"] = $url;
  89. }
  90. public function getPayload()
  91. {
  92. return $this->payload;
  93. }
  94. public function setPayload($payload)
  95. {
  96. $this->payload = $payload;
  97. $this->apiParam["payload"] = $payload;
  98. }
  99. public function getNotifyId()
  100. {
  101. return $this->notifyId;
  102. }
  103. public function setNotifyId($notifyId)
  104. {
  105. $this->notifyId = $notifyId;
  106. $this->apiParam["notify_id"] = $notifyId;
  107. }
  108. }