1 | <?php |
||
20 | class GCM extends MessageBase |
||
21 | { |
||
22 | /** |
||
23 | * It`s possible to send the same message to up to 1000 registration IDs in one request |
||
24 | */ |
||
25 | const MAX_RECIPIENTS_PER_MESSAGE_COUNT = 1000; |
||
26 | |||
27 | /** |
||
28 | * Allow test the request without actually sending the message |
||
29 | * |
||
30 | * @var boolean |
||
31 | */ |
||
32 | private $dryRun = false; |
||
33 | |||
34 | /** |
||
35 | * If there is already a message with the same collapse key (and registration ID) |
||
36 | * stored and waiting for delivery, the old message will be discarded |
||
37 | * and the new message will take its place |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | private $collapseKey; |
||
42 | |||
43 | /** |
||
44 | * Message payload data |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | private $payloadData; |
||
49 | |||
50 | /** |
||
51 | * If the device is connected but idle, the message will still be delivered right away |
||
52 | * unless the delay_while_idle flag is set to true |
||
53 | * |
||
54 | * @var boolean |
||
55 | */ |
||
56 | private $delayWhileIdle; |
||
57 | |||
58 | /** |
||
59 | * Package name of you application |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | private $packageName; |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getMessageType() |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getCollapseKey() |
||
80 | |||
81 | /** |
||
82 | * @param string $collapseKey |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function setCollapseKey($collapseKey) |
||
90 | |||
91 | /** |
||
92 | * @return boolean |
||
93 | */ |
||
94 | public function isDelayWhileIdle() |
||
98 | |||
99 | /** |
||
100 | * @param boolean $delayWhileIdle |
||
101 | * @return $this |
||
102 | */ |
||
103 | public function setDelayWhileIdle($delayWhileIdle) |
||
108 | |||
109 | /** |
||
110 | * @return boolean |
||
111 | */ |
||
112 | public function isDryRun() |
||
116 | |||
117 | /** |
||
118 | * @param boolean $dryRun |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function setDryRun($dryRun) |
||
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getPackageName() |
||
134 | |||
135 | /** |
||
136 | * @param string $packageName |
||
137 | * @return $this |
||
138 | */ |
||
139 | public function setPackageName($packageName) |
||
144 | |||
145 | /** |
||
146 | * @return array |
||
147 | */ |
||
148 | public function getPayloadData() |
||
152 | |||
153 | /** |
||
154 | * @param array $payloadData |
||
155 | * @return $this |
||
156 | */ |
||
157 | public function setPayloadData($payloadData) |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function validateRecipient($token) |
||
177 | } |
||
178 |