@@ -22,7 +22,7 @@ class Android implements \JsonSerializable
22
22
* @var int
23
23
*/
24
24
private $ badges ;
25
-
25
+
26
26
private $ banner ;
27
27
private $ customIcon ;
28
28
@@ -33,24 +33,33 @@ class Android implements \JsonSerializable
33
33
* @var int
34
34
*/
35
35
private $ gcmTtl ;
36
+
37
+ /**
38
+ * Identifier to group related notifications.
39
+ * Messages with the same thread ID will be grouped in the Notification Center.
40
+ *
41
+ * @var string|null
42
+ */
43
+ private $ groupId ;
44
+
36
45
private $ header ;
37
-
46
+
38
47
/**
39
48
* The icon background color on Lollipop, #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
40
49
*
41
50
* @var string
42
51
*/
43
52
private $ ibc ;
44
-
53
+
45
54
private $ icon ;
46
-
55
+
47
56
/**
48
57
* The LED hex color, device will do its best approximation.
49
58
*
50
59
* @var string
51
60
*/
52
61
private $ led ;
53
-
62
+
54
63
/**
55
64
* The priority of the push in the Android push drawer, valid values are -2, -1, 0, 1 and 2.
56
65
*
@@ -60,7 +69,7 @@ class Android implements \JsonSerializable
60
69
61
70
private $ rootParams ;
62
71
private $ sound ;
63
-
72
+
64
73
/**
65
74
* A boolean used to force vibration for high-priority pushes.
66
75
*
@@ -113,12 +122,20 @@ public function getGcmTtl()
113
122
114
123
}
115
124
125
+ /**
126
+ * @return string|null
127
+ */
128
+ public function getGroupId ()
129
+ {
130
+ return $ this ->groupId ;
131
+ }
132
+
116
133
public function getHeader ()
117
134
{
118
135
return $ this ->header ;
119
136
120
137
}
121
-
138
+
122
139
/**
123
140
* Gets the icon background color on Lollipop, #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
124
141
*
@@ -133,7 +150,7 @@ public function getIcon()
133
150
{
134
151
return $ this ->icon ;
135
152
}
136
-
153
+
137
154
/**
138
155
* Gets the LED hex color, device will do its best approximation.
139
156
*
@@ -143,7 +160,7 @@ public function getLed()
143
160
{
144
161
return $ this ->led ;
145
162
}
146
-
163
+
147
164
/**
148
165
* Gets priority of the push in the Android push drawer, valid values are -2, -1, 0, 1 and 2.
149
166
*
@@ -163,7 +180,7 @@ public function getSound()
163
180
{
164
181
return $ this ->sound ;
165
182
}
166
-
183
+
167
184
/**
168
185
* Gets the boolean used to force vibration for high-priority pushes.
169
186
*
@@ -173,14 +190,14 @@ public function isVibration()
173
190
{
174
191
return $ this ->vibration ;
175
192
}
176
-
193
+
177
194
/**
178
195
* {@inheritdoc}
179
196
*/
180
197
public function jsonSerialize ()
181
198
{
182
199
$ json = [];
183
-
200
+
184
201
isset ($ this ->badges ) ? $ json ['android_badges ' ] = $ this ->badges : false ;
185
202
isset ($ this ->banner ) ? $ json ['android_banner ' ] = $ this ->banner : false ;
186
203
isset ($ this ->customIcon ) ? $ json ['android_custom_icon ' ] = $ this ->customIcon : false ;
@@ -193,9 +210,13 @@ public function jsonSerialize()
193
210
isset ($ this ->rootParams ) ? $ json ['android_root_params ' ] = $ this ->rootParams : false ;
194
211
isset ($ this ->sound ) ? $ json ['android_sound ' ] = $ this ->sound : false ;
195
212
isset ($ this ->vibration ) ? $ json ['android_vibration ' ] = ($ this ->vibration ? 1 : 0 ) : false ;
196
-
213
+
214
+ if ($ this ->groupId !== null ) {
215
+ $ json ['android_group_id ' ] = $ this ->groupId ;
216
+ }
217
+
197
218
return $ json ;
198
-
219
+
199
220
}
200
221
201
222
/**
@@ -208,7 +229,7 @@ public function jsonSerialize()
208
229
public function setBadges ($ badges )
209
230
{
210
231
$ this ->badges = $ badges ;
211
-
232
+
212
233
return $ this ;
213
234
}
214
235
@@ -242,14 +263,24 @@ public function setGcmTtl($gcmTtl)
242
263
return $ this ;
243
264
}
244
265
266
+ /**
267
+ * @param string|null $groupId
268
+ */
269
+ public function setGroupId ($ groupId )
270
+ {
271
+ $ this ->groupId = $ groupId ;
272
+
273
+ return $ this ;
274
+ }
275
+
245
276
public function setHeader ($ header )
246
277
{
247
278
$ this ->header = $ header ;
248
279
249
280
return $ this ;
250
281
251
282
}
252
-
283
+
253
284
/**
254
285
* Sets the icon background color on Lollipop, #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
255
286
*
@@ -260,7 +291,7 @@ public function setHeader($header)
260
291
public function setIbc ($ ibc )
261
292
{
262
293
$ this ->ibc = $ ibc ;
263
-
294
+
264
295
return $ this ;
265
296
}
266
297
@@ -270,7 +301,7 @@ public function setIcon($icon)
270
301
271
302
return $ this ;
272
303
}
273
-
304
+
274
305
/**
275
306
* Sets the LED hex color, device will do its best approximation.
276
307
*
@@ -281,10 +312,10 @@ public function setIcon($icon)
281
312
public function setLed ($ led )
282
313
{
283
314
$ this ->led = $ led ;
284
-
315
+
285
316
return $ this ;
286
317
}
287
-
318
+
288
319
/**
289
320
* Sets the priority of the push in the Android push drawer, valid values are -2, -1, 0, 1 and 2.
290
321
*
@@ -295,7 +326,7 @@ public function setLed($led)
295
326
public function setPriority ($ priority )
296
327
{
297
328
$ this ->priority = $ priority ;
298
-
329
+
299
330
return $ this ;
300
331
}
301
332
@@ -312,7 +343,7 @@ public function setSound($sound)
312
343
313
344
return $ this ;
314
345
}
315
-
346
+
316
347
/**
317
348
* Sets the boolean used to force vibration for high-priority pushes.
318
349
*
@@ -323,7 +354,7 @@ public function setSound($sound)
323
354
public function setVibration ($ vibration )
324
355
{
325
356
$ this ->vibration = $ vibration ;
326
-
357
+
327
358
return $ this ;
328
359
}
329
360
}
0 commit comments