1 | <?php |
||
8 | class WebPushMessage |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $title; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $actions = []; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $badge; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $body; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $dir; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $icon; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $image; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $lang; |
||
49 | |||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | protected $renotify; |
||
54 | |||
55 | /** |
||
56 | * @var bool |
||
57 | */ |
||
58 | protected $requireInteraction; |
||
59 | |||
60 | /** |
||
61 | * @var string |
||
62 | */ |
||
63 | protected $tag; |
||
64 | |||
65 | /** |
||
66 | * @var array |
||
67 | */ |
||
68 | protected $vibrate; |
||
69 | |||
70 | /** |
||
71 | * @var mixed |
||
72 | */ |
||
73 | protected $data; |
||
74 | |||
75 | /** |
||
76 | * @var mixed |
||
77 | */ |
||
78 | protected $options; |
||
79 | |||
80 | /** |
||
81 | 3 | * Set the notification title. |
|
82 | * |
||
83 | 3 | * @param string $value |
|
84 | * @return $this |
||
85 | 3 | */ |
|
86 | public function title($value) |
||
92 | |||
93 | /** |
||
94 | * Add a notification action. |
||
95 | 3 | * |
|
96 | * @param string $title |
||
97 | 3 | * @param string $action |
|
98 | * @return $this |
||
99 | 3 | */ |
|
100 | public function action($title, $action) |
||
106 | |||
107 | /** |
||
108 | 1 | * Set the notification badge. |
|
109 | * |
||
110 | 1 | * @param string $value |
|
111 | * @return $this |
||
112 | 1 | */ |
|
113 | public function badge($value) |
||
119 | |||
120 | /** |
||
121 | 3 | * Set the notification body. |
|
122 | * |
||
123 | 3 | * @param string $value |
|
124 | * @return $this |
||
125 | 3 | */ |
|
126 | public function body($value) |
||
132 | |||
133 | /** |
||
134 | 1 | * Set the notification direction. |
|
135 | * |
||
136 | 1 | * @param string $value |
|
137 | * @return $this |
||
138 | 1 | */ |
|
139 | public function dir($value) |
||
145 | |||
146 | /** |
||
147 | 3 | * Set the notification icon url. |
|
148 | * |
||
149 | 3 | * @param string $value |
|
150 | * @return $this |
||
151 | 3 | */ |
|
152 | public function icon($value) |
||
158 | |||
159 | /** |
||
160 | 1 | * Set the notification image url. |
|
161 | * |
||
162 | 1 | * @param string $value |
|
163 | * @return $this |
||
164 | 1 | */ |
|
165 | public function image($value) |
||
171 | |||
172 | /** |
||
173 | 1 | * Set the notification language. |
|
174 | * |
||
175 | 1 | * @param string $value |
|
176 | * @return $this |
||
177 | 1 | */ |
|
178 | public function lang($value) |
||
184 | 1 | ||
185 | /** |
||
186 | 1 | * @param bool $value |
|
187 | * @return $this |
||
188 | 1 | */ |
|
189 | public function renotify($value = true) |
||
195 | 1 | ||
196 | /** |
||
197 | 1 | * @param bool $value |
|
198 | * @return $this |
||
199 | 1 | */ |
|
200 | public function requireInteraction($value = true) |
||
206 | |||
207 | /** |
||
208 | 1 | * Set the notification tag. |
|
209 | * |
||
210 | 1 | * @param string $value |
|
211 | * @return $this |
||
212 | 1 | */ |
|
213 | public function tag($value) |
||
219 | |||
220 | /** |
||
221 | 1 | * Set the notification vibration pattern. |
|
222 | * |
||
223 | 1 | * @param array $value |
|
224 | * @return $this |
||
225 | 1 | */ |
|
226 | public function vibrate($value) |
||
232 | |||
233 | /** |
||
234 | 3 | * Set the notification arbitrary data. |
|
235 | * |
||
236 | 3 | * @param mixed $value |
|
237 | * @return $this |
||
238 | 3 | */ |
|
239 | public function data($value) |
||
245 | |||
246 | 15 | /** |
|
247 | * Set the notification options. |
||
248 | 15 | * |
|
249 | * @param mixed $value |
||
250 | * @return $this |
||
251 | */ |
||
252 | public function options($value) |
||
258 | |||
259 | /** |
||
260 | * Get an array representation of the message. |
||
261 | * |
||
262 | * @return array |
||
263 | */ |
||
264 | public function toArray() |
||
268 | } |
||
269 |