1 | <?php |
||
20 | class APNS extends MessageBase |
||
21 | { |
||
22 | /** |
||
23 | * APNs does not support multicast sending |
||
24 | */ |
||
25 | const MAX_RECIPIENTS_PER_MESSAGE_COUNT = 1; |
||
26 | |||
27 | /** |
||
28 | * The message’s priority. Provide one of the following values: |
||
29 | * - 10 The push message is sent immediately |
||
30 | * - 5 The push message is sent at a time that conserves power on the device receiving it |
||
31 | * |
||
32 | * @var integer |
||
33 | */ |
||
34 | protected $priority; |
||
35 | |||
36 | /** |
||
37 | * Message text of an alert |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | private $alert; |
||
42 | |||
43 | /** |
||
44 | * The number to display as the badge of the application icon |
||
45 | * |
||
46 | * @var integer |
||
47 | */ |
||
48 | private $badge; |
||
49 | |||
50 | /** |
||
51 | * The name of a sound file in the application bundle |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | private $sound; |
||
56 | |||
57 | /** |
||
58 | * Category option for custom notification actions (iOS 8+) |
||
59 | * |
||
60 | * @var string |
||
61 | */ |
||
62 | private $category; |
||
63 | |||
64 | /** |
||
65 | * Provide this key with a value of 1 to indicate that new content is available |
||
66 | * |
||
67 | * @var bool |
||
68 | */ |
||
69 | private $contentAvailable; |
||
70 | |||
71 | /** |
||
72 | * Custom properties |
||
73 | * |
||
74 | * @var array |
||
75 | */ |
||
76 | private $customPayloadData = array(); |
||
77 | |||
78 | /** |
||
79 | * Safari url args |
||
80 | * |
||
81 | * @var array |
||
82 | */ |
||
83 | private $urlArgs; |
||
84 | |||
85 | /** |
||
86 | * Gets message type |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getMessageType() |
||
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getAlert() |
||
102 | |||
103 | /** |
||
104 | * @param string $alert |
||
105 | * @return $this |
||
106 | */ |
||
107 | public function setAlert($alert) |
||
116 | |||
117 | /** |
||
118 | * @return int |
||
119 | */ |
||
120 | public function getBadge() |
||
124 | |||
125 | /** |
||
126 | * @param int $badge |
||
127 | * @return $this |
||
128 | */ |
||
129 | public function setBadge($badge) |
||
139 | |||
140 | /** |
||
141 | * @return array |
||
142 | */ |
||
143 | public function getCustomPayloadData() |
||
147 | |||
148 | /** |
||
149 | * @param array $customPayloadData |
||
150 | */ |
||
151 | public function setCustomPayloadData($customPayloadData) |
||
155 | |||
156 | /** |
||
157 | * @return boolean |
||
158 | */ |
||
159 | public function isContentAvailable() |
||
163 | |||
164 | /** |
||
165 | * @param boolean $contentAvailable |
||
166 | * @return $this |
||
167 | */ |
||
168 | public function setContentAvailable($contentAvailable) |
||
178 | |||
179 | /** |
||
180 | * @return int |
||
181 | */ |
||
182 | public function getPriority() |
||
186 | |||
187 | /** |
||
188 | * @param int $priority |
||
189 | */ |
||
190 | public function setPriority($priority) |
||
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | */ |
||
198 | public function getSound() |
||
202 | |||
203 | /** |
||
204 | * @param string $sound |
||
205 | * @return $this |
||
206 | */ |
||
207 | public function setSound($sound) |
||
216 | |||
217 | /** |
||
218 | * @return string |
||
219 | */ |
||
220 | public function getCategory() |
||
224 | |||
225 | /** |
||
226 | * @param string $category |
||
227 | * @return $this |
||
228 | */ |
||
229 | public function setCategory($category) |
||
238 | |||
239 | /** |
||
240 | * @return array |
||
241 | */ |
||
242 | public function getUrlArgs() |
||
246 | |||
247 | /** |
||
248 | * @param array $urlArgs |
||
249 | * @return $this |
||
250 | */ |
||
251 | public function setUrlArgs($urlArgs) |
||
256 | |||
257 | /** |
||
258 | * {@inheritdoc} |
||
259 | */ |
||
260 | public function validateRecipient($token) |
||
277 | } |
||
278 |