1 | <?php |
||
22 | class GcmMessage extends Message |
||
23 | { |
||
24 | const DEFAULT_TTL = 2419200; // 4 weeks |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $notificationPayload = []; |
||
30 | |||
31 | /** |
||
32 | * Get notification payload data. |
||
33 | * |
||
34 | * @return array |
||
35 | */ |
||
36 | public function getNotificationPayload() |
||
40 | |||
41 | /** |
||
42 | * Set notification payload data. |
||
43 | * |
||
44 | * @param array $payload |
||
45 | * |
||
46 | * @throws \ZendService\Google\Exception\InvalidArgumentException |
||
47 | * @throws \ZendService\Google\Exception\RuntimeException |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function setNotificationPayload(array $payload) |
||
61 | |||
62 | /** |
||
63 | * Add notification payload data. |
||
64 | * |
||
65 | * @param string $key |
||
66 | * @param mixed $value |
||
67 | * |
||
68 | * @throws \ZendService\Google\Exception\InvalidArgumentException |
||
69 | * @throws \ZendService\Google\Exception\RuntimeException |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function addNotificationPayload($key, $value) |
||
89 | |||
90 | /** |
||
91 | * Clear notification payload data. |
||
92 | */ |
||
93 | public function clearNotificationPayload() |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function toJson() |
||
130 | |||
131 | /** |
||
132 | * Retrieve payload. |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | protected function getCompoundPayload() |
||
149 | } |
||
150 |