1 | <?php |
||
25 | class ApnsBuilder |
||
26 | { |
||
27 | /** |
||
28 | * Get opened push service client. |
||
29 | * |
||
30 | * @param string $certificate |
||
31 | * @param string $passPhrase |
||
32 | * @param bool $sandbox |
||
33 | * |
||
34 | * @throws \Jgut\Tify\Exception\AdapterException |
||
35 | * |
||
36 | * @return \ZendService\Apple\Apns\Client\Message |
||
37 | */ |
||
38 | public function buildPushClient($certificate, $passPhrase = '', $sandbox = false) |
||
42 | |||
43 | /** |
||
44 | * Get opened feedback service client. |
||
45 | * |
||
46 | * @param string $certificate |
||
47 | * @param string $passPhrase |
||
48 | * @param bool $sandbox |
||
49 | * |
||
50 | * @throws \Jgut\Tify\Exception\AdapterException |
||
51 | * |
||
52 | * @return \ZendService\Apple\Apns\Client\Feedback |
||
53 | */ |
||
54 | public function buildFeedbackClient($certificate, $passPhrase = '', $sandbox = false) |
||
58 | |||
59 | /** |
||
60 | * Get opened client. |
||
61 | * |
||
62 | * @param \ZendService\Apple\Apns\Client\AbstractClient $client |
||
63 | * @param string $certificate |
||
64 | * @param string $passPhrase |
||
65 | * @param bool $sandbox |
||
66 | * |
||
67 | * @throws \Jgut\Tify\Exception\AdapterException |
||
68 | * |
||
69 | * @return \ZendService\Apple\Apns\Client\AbstractClient |
||
70 | * |
||
71 | * @codeCoverageIgnore |
||
72 | */ |
||
73 | protected function buildClient(AbstractClient $client, $certificate, $passPhrase = '', $sandbox = false) |
||
87 | |||
88 | /** |
||
89 | * Get service message from origin. |
||
90 | * |
||
91 | * @param \Jgut\Tify\Receiver\ApnsReceiver $receiver |
||
92 | * @param \Jgut\Tify\Notification $notification |
||
93 | * |
||
94 | * @throws \ZendService\Apple\Exception\RuntimeException |
||
95 | * |
||
96 | * @return \ZendService\Apple\Apns\Message |
||
97 | */ |
||
98 | public function buildPushMessage(ApnsReceiver $receiver, Notification $notification) |
||
148 | |||
149 | /** |
||
150 | * Message should have alert dictionary. |
||
151 | * |
||
152 | * @param \Jgut\Tify\Message $message |
||
153 | * |
||
154 | * @return bool |
||
155 | */ |
||
156 | private function shouldHaveAlert(Message $message) |
||
177 | } |
||
178 |