1 | <?php |
||
22 | class DefaultFactory implements Factory |
||
23 | { |
||
24 | /** |
||
25 | * Notification parameters list. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected static $notificationParams = [ |
||
30 | NotificationMessage::PARAMETER_TITLE, |
||
31 | NotificationMessage::PARAMETER_BODY, |
||
32 | NotificationMessage::PARAMETER_ICON, |
||
33 | NotificationMessage::PARAMETER_SOUND, |
||
34 | NotificationMessage::PARAMETER_TAG, |
||
35 | NotificationMessage::PARAMETER_COLOR, |
||
36 | NotificationMessage::PARAMETER_CLICK_ACTION, |
||
37 | NotificationMessage::PARAMETER_TITLE_LOC_KEY, |
||
38 | NotificationMessage::PARAMETER_TITLE_LOC_ARGS, |
||
39 | NotificationMessage::PARAMETER_BODY_LOC_KEY, |
||
40 | NotificationMessage::PARAMETER_BODY_LOC_ARGS, |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function buildPushClient($apiKey) |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | * |
||
68 | * @throws \ZendService\Google\Exception\InvalidArgumentException |
||
69 | * @throws \ZendService\Google\Exception\RuntimeException |
||
70 | */ |
||
71 | public function buildPushMessage(array $tokens, Notification $notification) |
||
91 | |||
92 | /** |
||
93 | * Message should have notification data. |
||
94 | * |
||
95 | * @param NotificationMessage $message |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | private function shouldHavePayload(NotificationMessage $message) |
||
113 | } |
||
114 |