GTAlert.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. class GTAlert extends GTApiRequest
  3. {
  4. /**
  5. * 通知消息标题
  6. */
  7. private $title;
  8. /**
  9. * 通知消息内容
  10. */
  11. private $body;
  12. /**
  13. * (用于多语言支持)指定执行按钮所使用的Localizable.strings
  14. */
  15. private $actionLocKey;
  16. /**
  17. * (用于多语言支持)指定Localizable.strings文件中相应的key
  18. */
  19. private $locKey;
  20. /**
  21. * 如果loc-key中使用了占位符,则在loc-args中指定各参数
  22. */
  23. private $locArgs;
  24. /**
  25. * 指定启动界面图片名
  26. */
  27. private $launchImage;
  28. /**
  29. * (用于多语言支持)对于标题指定执行按钮所使用的Localizable.strings,仅支持iOS8.2以上版本
  30. */
  31. private $titleLocKey;
  32. /**
  33. * 对于标题,如果loc-key中使用的占位符,则在loc-args中指定各参数,仅支持iOS8.2以上版本
  34. */
  35. private $titleLocArgs;
  36. /**
  37. * 通知子标题,仅支持iOS8.2以上版本
  38. */
  39. private $subtitle;
  40. /**
  41. * 当前本地化文件中的子标题字符串的关键字,仅支持iOS8.2以上版本
  42. */
  43. private $subtitleLocKey;
  44. /**
  45. * 当前本地化子标题内容中需要置换的变量参数 ,仅支持iOS8.2以上版本
  46. */
  47. private $subtitleLocArgs;
  48. public function getTitle()
  49. {
  50. return $this->title;
  51. }
  52. public function setTitle($title)
  53. {
  54. $this->title = $title;
  55. $this->apiParam["title"] = $title;
  56. }
  57. public function getBody()
  58. {
  59. return $this->body;
  60. }
  61. public function setBody($body)
  62. {
  63. $this->body = $body;
  64. $this->apiParam["body"] = $body;
  65. }
  66. public function getActionLocKey()
  67. {
  68. return $this->actionLocKey;
  69. }
  70. public function setActionLocKey($actionLocKey)
  71. {
  72. $this->actionLocKey = $actionLocKey;
  73. $this->apiParam["action-loc-key"] = $actionLocKey;
  74. }
  75. public function getLocKey()
  76. {
  77. return $this->locKey;
  78. }
  79. public function setLocKey($locKey)
  80. {
  81. $this->locKey = $locKey;
  82. $this->apiParam["loc-key"] = $locKey;
  83. }
  84. public function getLocArgs()
  85. {
  86. return $this->locArgs;
  87. }
  88. public function setLocArgs($locArgs)
  89. {
  90. $this->locArgs = $locArgs;
  91. }
  92. public function getLaunchImage()
  93. {
  94. return $this->launchImage;
  95. }
  96. public function setLaunchImage($launchImage)
  97. {
  98. $this->launchImage = $launchImage;
  99. $this->apiParam["launch-image"] = $launchImage;
  100. }
  101. public function getTitleLocKey()
  102. {
  103. return $this->titleLocKey;
  104. }
  105. public function setTitleLocKey($titleLocKey)
  106. {
  107. $this->titleLocKey = $titleLocKey;
  108. $this->apiParam["title-loc-key"] = $titleLocKey;
  109. }
  110. public function getTitleLocArgs()
  111. {
  112. return $this->titleLocArgs;
  113. }
  114. public function setTitleLocArgs($titleLocArgs)
  115. {
  116. $this->titleLocArgs = $titleLocArgs;
  117. }
  118. public function getSubtitle()
  119. {
  120. return $this->subtitle;
  121. }
  122. public function setSubtitle($subtitle)
  123. {
  124. $this->subtitle = $subtitle;
  125. $this->apiParam["subtitle"] = $subtitle;
  126. }
  127. public function getSubtitleLocKey()
  128. {
  129. return $this->subtitleLocKey;
  130. }
  131. public function setSubtitleLocKey($subtitleLocKey)
  132. {
  133. $this->subtitleLocKey = $subtitleLocKey;
  134. $this->apiParam["subtitle-loc-key"] = $subtitleLocKey;
  135. }
  136. public function getSubtitleLocArgs()
  137. {
  138. return $this->subtitleLocArgs;
  139. }
  140. public function setSubtitleLocArgs($subtitleLocArgs)
  141. {
  142. $this->subtitleLocArgs = $subtitleLocArgs;
  143. }
  144. public function getApiParam()
  145. {
  146. if ($this->subtitleLocArgs != null){
  147. $this->apiParam["subtitle-loc-args"] = $this->subtitleLocArgs;
  148. }
  149. if ($this->titleLocArgs != null){
  150. $this->apiParam["title-loc-args"] = $this->titleLocArgs;
  151. }
  152. if ($this->locArgs != null){
  153. $this->apiParam["loc-args"] = $this->locArgs;
  154. }
  155. return $this->apiParam;
  156. }
  157. }