From 97324a702854b26f3bf9fc938473c26508256a7b Mon Sep 17 00:00:00 2001 From: Marcin Flis Date: Thu, 16 Aug 2018 13:58:25 +0200 Subject: [PATCH] add existing_android_channel_id field to NotificationRequest --- .../model/notification/Notification.java | 16 ++++++++++++++++ .../notification/NotificationRequestBuilder.java | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/src/main/java/com/currencyfair/onesignal/model/notification/Notification.java b/src/main/java/com/currencyfair/onesignal/model/notification/Notification.java index b48ed36..340d338 100644 --- a/src/main/java/com/currencyfair/onesignal/model/notification/Notification.java +++ b/src/main/java/com/currencyfair/onesignal/model/notification/Notification.java @@ -681,6 +681,14 @@ public class Notification { @JsonProperty("isChrome") private Boolean chrome; + /** + * Use this if you have client side Android Oreo Channels you have already defined in your app with code. + *

+ * ANDROID + */ + @JsonProperty("existing_android_channel_id") + private String existingAndroidChannelId; + public String getId() { return id; } @@ -1169,6 +1177,14 @@ public void setChrome(Boolean chrome) { this.chrome = chrome; } + public void setExistingAndroidChannelId(String channelId) { + this.existingAndroidChannelId = channelId; + } + + public String getExistingAndroidChannelId() { + return existingAndroidChannelId; + } + @Override public String toString() { return ToStringBuilder.reflectionToString(this); diff --git a/src/main/java/com/currencyfair/onesignal/model/notification/NotificationRequestBuilder.java b/src/main/java/com/currencyfair/onesignal/model/notification/NotificationRequestBuilder.java index 29dc7e2..3438bdd 100644 --- a/src/main/java/com/currencyfair/onesignal/model/notification/NotificationRequestBuilder.java +++ b/src/main/java/com/currencyfair/onesignal/model/notification/NotificationRequestBuilder.java @@ -91,6 +91,7 @@ public final class NotificationRequestBuilder { private Boolean wpwns; private Boolean adm; private Boolean chrome; + private String existingAndroidChannelId; private NotificationRequestBuilder() { } @@ -505,6 +506,11 @@ public NotificationRequestBuilder withChrome(Boolean chrome) { return this; } + public NotificationRequestBuilder withExistingAndroidChannelId(String channelId) { + this.existingAndroidChannelId = channelId; + return this; + } + public NotificationRequest build() { NotificationRequest notificationRequest = new NotificationRequest(); notificationRequest.setId(id); @@ -571,6 +577,7 @@ public NotificationRequest build() { notificationRequest.setWpwns(wpwns); notificationRequest.setAdm(adm); notificationRequest.setChrome(chrome); + notificationRequest.setExistingAndroidChannelId(existingAndroidChannelId); return notificationRequest; } }