@@ 272-290 (lines=19) @@ | ||
269 | * |
|
270 | * @return array |
|
271 | */ |
|
272 | public function toiOS() |
|
273 | { |
|
274 | $message = [ |
|
275 | 'apns' => [ |
|
276 | 'aps' => [ |
|
277 | 'alert' => [ |
|
278 | 'title' => $this->title, |
|
279 | 'body' => $this->body, |
|
280 | ], |
|
281 | 'sound' => $this->sound, |
|
282 | 'badge' => $this->badge, |
|
283 | ], |
|
284 | ], |
|
285 | ]; |
|
286 | ||
287 | $this->formatMessage($message); |
|
288 | ||
289 | return $message; |
|
290 | } |
|
291 | ||
292 | /** |
|
293 | * Format the message for Android. |
|
@@ 297-313 (lines=17) @@ | ||
294 | * |
|
295 | * @return array |
|
296 | */ |
|
297 | public function toAndroid() |
|
298 | { |
|
299 | $message = [ |
|
300 | 'fcm' => [ |
|
301 | 'notification' => [ |
|
302 | 'title' => $this->title, |
|
303 | 'body' => $this->body, |
|
304 | 'sound' => $this->sound, |
|
305 | 'icon' => $this->icon ?: 'icon', |
|
306 | ], |
|
307 | ], |
|
308 | ]; |
|
309 | ||
310 | $this->formatMessage($message); |
|
311 | ||
312 | return $message; |
|
313 | } |
|
314 | ||
315 | /** |
|
316 | * Return the current platform. |