1 | <?php |
||
12 | class Pusher |
||
13 | { |
||
14 | /** |
||
15 | * Title of the message. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $title = ""; |
||
20 | |||
21 | /** |
||
22 | * Body of the message. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $body = ""; |
||
27 | |||
28 | /** |
||
29 | * Badge of message. |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $badge = null; |
||
34 | |||
35 | /** |
||
36 | * Payload of the message. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $payload = []; |
||
41 | |||
42 | /** |
||
43 | * Icon of the message. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $icon = ""; |
||
48 | |||
49 | /** |
||
50 | * Small Icon. |
||
51 | * |
||
52 | * @var null |
||
53 | */ |
||
54 | protected $smallIcon = null; |
||
55 | |||
56 | /** |
||
57 | * Banner of the message. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $banner = ""; |
||
62 | |||
63 | /** |
||
64 | * Sond of the message. |
||
65 | * |
||
66 | * @var string |
||
67 | */ |
||
68 | protected $sound = 'default'; |
||
69 | |||
70 | /** |
||
71 | * Priority of the message. |
||
72 | * |
||
73 | * @var int |
||
74 | */ |
||
75 | protected $priority = 1; |
||
76 | |||
77 | /** |
||
78 | * Vibration of the message. |
||
79 | * |
||
80 | * @var int |
||
81 | */ |
||
82 | protected $vibration = 1; |
||
83 | |||
84 | /** |
||
85 | * Icon Background Color. |
||
86 | * @var string |
||
87 | */ |
||
88 | protected $ibc = "#ffffff"; |
||
89 | |||
90 | /** |
||
91 | * Pushwoosh Instance. |
||
92 | * |
||
93 | * @var |
||
94 | */ |
||
95 | protected $push; |
||
96 | |||
97 | /** |
||
98 | * Send to devices. |
||
99 | * |
||
100 | * @var array |
||
101 | */ |
||
102 | protected $tokens = []; |
||
103 | |||
104 | /** |
||
105 | * PushWooshManager constructor. |
||
106 | * |
||
107 | * @param PusherFactory $factory |
||
108 | */ |
||
109 | public function __construct(PusherFactory $factory) |
||
121 | |||
122 | /** |
||
123 | * @param mixed $title |
||
124 | * @return $this |
||
125 | */ |
||
126 | public function setTitle($title) |
||
132 | |||
133 | /** |
||
134 | * @param mixed $body |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function setBody($body) |
||
143 | |||
144 | /** |
||
145 | * @param mixed $badge |
||
146 | * @return $this |
||
147 | */ |
||
148 | public function setBadge($badge) |
||
154 | |||
155 | /** |
||
156 | * @param mixed $payload |
||
157 | * @return $this |
||
158 | */ |
||
159 | public function setPayload(array $payload) |
||
165 | |||
166 | /** |
||
167 | * @param mixed $icon |
||
168 | * @return $this |
||
169 | */ |
||
170 | public function setIcon($icon) |
||
176 | |||
177 | /** |
||
178 | * @param mixed $smallIcon |
||
179 | * @return $this |
||
180 | */ |
||
181 | public function setSmallIcon($smallIcon) |
||
187 | |||
188 | /** |
||
189 | * @param mixed $banner |
||
190 | * @return $this |
||
191 | */ |
||
192 | public function setBanner($banner) |
||
198 | |||
199 | /** |
||
200 | * @param string $sound |
||
201 | * @return $this |
||
202 | */ |
||
203 | public function setSound($sound) |
||
209 | |||
210 | /** |
||
211 | * @param int $priority |
||
212 | * @return $this |
||
213 | */ |
||
214 | public function setPriority($priority) |
||
220 | |||
221 | /** |
||
222 | * @param int $vibration |
||
223 | * @return $this |
||
224 | */ |
||
225 | public function setVibration($vibration) |
||
231 | |||
232 | /** |
||
233 | * @param string $ibc |
||
234 | * @return $this |
||
235 | */ |
||
236 | public function setIbc($ibc) |
||
242 | |||
243 | /** |
||
244 | * Set Device token. |
||
245 | * |
||
246 | * @param $token |
||
247 | * @return $this |
||
248 | */ |
||
249 | public function setToken($token) { |
||
255 | |||
256 | /** |
||
257 | * Set Device token array. |
||
258 | * |
||
259 | * @param array $tokens |
||
260 | * @return $this |
||
261 | */ |
||
262 | public function setTokens(array $tokens) { |
||
268 | |||
269 | /** |
||
270 | * Get Android Settings. |
||
271 | * |
||
272 | * @return Android |
||
273 | */ |
||
274 | protected function getAndroidSettings() { |
||
291 | |||
292 | /** |
||
293 | * Get IOS Settings. |
||
294 | * |
||
295 | * @return IOS |
||
296 | */ |
||
297 | protected function getIosSettings() { |
||
302 | |||
303 | /** |
||
304 | * @param $token |
||
305 | * @return CreateMessageRequest |
||
306 | */ |
||
307 | protected function getPushRequest($token) |
||
323 | |||
324 | /** |
||
325 | * Send Push to tokens. |
||
326 | * |
||
327 | * @return object |
||
328 | */ |
||
329 | public function send($message, $callback) { |
||
339 | |||
340 | } |
||
341 | |||
342 |