@@ -31,6 +31,7 @@ public class PushPayload implements PushModel {
3131 private static final String PLATFORM = "platform" ;
3232 private static final String AUDIENCE = "audience" ;
3333 private static final String NOTIFICATION = "notification" ;
34+ private static final String INAPPMESSAGE = "inapp_message" ;
3435 private static final String MESSAGE = "message" ;
3536 private static final String OPTIONS = "options" ;
3637 private static final String SMS = "sms_message" ;
@@ -52,6 +53,7 @@ public class PushPayload implements PushModel {
5253 private final Platform platform ;
5354 private final Audience audience ;
5455 private final Notification notification ;
56+ private final InappMessage inappMessage ;
5557 private final Message message ;
5658 private Options options ;
5759 private SMS sms ;
@@ -60,10 +62,11 @@ public class PushPayload implements PushModel {
6062 protected Map <String , JsonObject > custom ;
6163
6264 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 ) {
6466 this .platform = platform ;
6567 this .audience = audience ;
6668 this .notification = notification ;
69+ this .inappMessage = inappMessage ;
6770 this .message = message ;
6871 this .options = options ;
6972 this .sms = sms ;
@@ -186,6 +189,9 @@ public JsonElement toJSON() {
186189 if (null != notification ) {
187190 json .add (NOTIFICATION , notification .toJSON ());
188191 }
192+ if (null != inappMessage ) {
193+ json .add (INAPPMESSAGE , inappMessage .toJSON ());
194+ }
189195 if (null != message ) {
190196 json .add (MESSAGE , message .toJSON ());
191197 }
@@ -261,6 +267,7 @@ public static class Builder {
261267 private Platform platform = null ;
262268 private Audience audience = null ;
263269 private Notification notification = null ;
270+ private InappMessage inappMessage = null ;
264271 private Message message = null ;
265272 private Options options = null ;
266273 private SMS sms = null ;
@@ -291,6 +298,11 @@ public Builder setNotification(Notification notification) {
291298 this .notification = notification ;
292299 return this ;
293300 }
301+
302+ public Builder setInappMessage (InappMessage inappMessage ) {
303+ this .inappMessage = inappMessage ;
304+ return this ;
305+ }
294306
295307 public Builder setMessage (Message message ) {
296308 this .message = message ;
@@ -336,7 +348,7 @@ public PushPayload build() {
336348 options = Options .sendno ();
337349 }
338350
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 );
340352 }
341353 }
342354}
0 commit comments