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