1 | <?php |
||
7 | class GCMNotification extends AbstractNotification |
||
8 | { |
||
9 | /** |
||
10 | * |
||
11 | */ |
||
12 | const GCM_HOST = 'https://gcm-http.googleapis.com/gcm/send'; |
||
13 | |||
14 | /** |
||
15 | * |
||
16 | */ |
||
17 | const MAX_TOKENS = 1000; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $headers; |
||
23 | |||
24 | /** |
||
25 | * GCMNotificationComponent constructor. |
||
26 | * |
||
27 | * @param $apiKey |
||
28 | */ |
||
29 | 2 | public function __construct($apiKey) |
|
38 | |||
39 | /** |
||
40 | * |
||
41 | */ |
||
42 | 2 | public function send() |
|
57 | |||
58 | /** |
||
59 | * @param $message |
||
60 | */ |
||
61 | 1 | private function sendMessage($message) |
|
69 | |||
70 | /** |
||
71 | * @param MessageInterface $message |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | 1 | final protected function createPayload(MessageInterface $message) |
|
92 | |||
93 | 1 | private function getTokens(MessageInterface $message) |
|
106 | |||
107 | 1 | public function enqueue(MessageInterface $message) |
|
125 | |||
126 | 1 | protected function getConnectionParams() |
|
135 | } |