@@ -31,6 +31,7 @@ public class PushPayload implements PushModel {
31
31
private static final String PLATFORM = "platform" ;
32
32
private static final String AUDIENCE = "audience" ;
33
33
private static final String NOTIFICATION = "notification" ;
34
+ private static final String INAPPMESSAGE = "inapp_message" ;
34
35
private static final String MESSAGE = "message" ;
35
36
private static final String OPTIONS = "options" ;
36
37
private static final String SMS = "sms_message" ;
@@ -52,6 +53,7 @@ public class PushPayload implements PushModel {
52
53
private final Platform platform ;
53
54
private final Audience audience ;
54
55
private final Notification notification ;
56
+ private final InappMessage inappMessage ;
55
57
private final Message message ;
56
58
private Options options ;
57
59
private SMS sms ;
@@ -60,10 +62,11 @@ public class PushPayload implements PushModel {
60
62
protected Map <String , JsonObject > custom ;
61
63
62
64
private PushPayload (Platform platform , Audience audience ,
63
- Notification notification , Message message , Options options , SMS sms , String cid , String target , Map <String , JsonObject > custom ) {
65
+ Notification notification , InappMessage inappMessage , Message message , Options options , SMS sms , String cid , String target , Map <String , JsonObject > custom ) {
64
66
this .platform = platform ;
65
67
this .audience = audience ;
66
68
this .notification = notification ;
69
+ this .inappMessage = inappMessage ;
67
70
this .message = message ;
68
71
this .options = options ;
69
72
this .sms = sms ;
@@ -186,6 +189,9 @@ public JsonElement toJSON() {
186
189
if (null != notification ) {
187
190
json .add (NOTIFICATION , notification .toJSON ());
188
191
}
192
+ if (null != inappMessage ) {
193
+ json .add (INAPPMESSAGE , inappMessage .toJSON ());
194
+ }
189
195
if (null != message ) {
190
196
json .add (MESSAGE , message .toJSON ());
191
197
}
@@ -261,6 +267,7 @@ public static class Builder {
261
267
private Platform platform = null ;
262
268
private Audience audience = null ;
263
269
private Notification notification = null ;
270
+ private InappMessage inappMessage = null ;
264
271
private Message message = null ;
265
272
private Options options = null ;
266
273
private SMS sms = null ;
@@ -291,6 +298,11 @@ public Builder setNotification(Notification notification) {
291
298
this .notification = notification ;
292
299
return this ;
293
300
}
301
+
302
+ public Builder setInappMessage (InappMessage inappMessage ) {
303
+ this .inappMessage = inappMessage ;
304
+ return this ;
305
+ }
294
306
295
307
public Builder setMessage (Message message ) {
296
308
this .message = message ;
@@ -336,7 +348,7 @@ public PushPayload build() {
336
348
options = Options .sendno ();
337
349
}
338
350
339
- return new PushPayload (platform , audience , notification , message , options , sms , cid , target , custom );
351
+ return new PushPayload (platform , audience , notification , inappMessage , message , options , sms , cid , target , custom );
340
352
}
341
353
}
342
354
}
0 commit comments