@@ -18,6 +18,8 @@ public class AndroidNotification extends PlatformNotification {
1818 private static final String BIG_PIC_PATH = "big_pic_path" ;
1919 private static final String PRIORITY = "priority" ;
2020 private static final String CATEGORY = "category" ;
21+ private static final String LARGE_ICON = "large_icon" ;
22+ private static final String INTENT = "intent" ;
2123
2224 private final String title ;
2325 private final int builderId ;
@@ -30,9 +32,11 @@ public class AndroidNotification extends PlatformNotification {
3032 private String big_pic_path ;
3133 private int priority ;
3234 private String category ;
35+ private String large_icon ;
36+ private JsonObject intent ;
3337
3438 private AndroidNotification (Object alert , String title , int builderId , int style , int alertType , String bigText ,
35- Object inbox , String bigPicPath , int priority , String category ,
39+ Object inbox , String bigPicPath , int priority , String category ,String large_icon , JsonObject intent ,
3640 Map <String , String > extras ,
3741 Map <String , Number > numberExtras ,
3842 Map <String , Boolean > booleanExtras ,
@@ -48,6 +52,8 @@ private AndroidNotification(Object alert, String title, int builderId, int style
4852 this .big_pic_path = bigPicPath ;
4953 this .priority = priority ;
5054 this .category = category ;
55+ this .large_icon = large_icon ;
56+ this .intent = intent ;
5157 }
5258
5359 public static Builder newBuilder () {
@@ -115,6 +121,14 @@ public JsonElement toJSON() {
115121 json .add (CATEGORY , new JsonPrimitive (category ));
116122 }
117123
124+ if (null != large_icon ) {
125+ json .add (LARGE_ICON , new JsonPrimitive (large_icon ));
126+ }
127+
128+ if (null != intent ) {
129+ json .add (INTENT , intent );
130+ }
131+
118132 return json ;
119133 }
120134
@@ -129,6 +143,8 @@ public static class Builder extends PlatformNotification.Builder<AndroidNotifica
129143 private String big_pic_path ;
130144 private int priority ;
131145 private String category ;
146+ private String large_icon ;
147+ private JsonObject intent ;
132148
133149 protected Builder getThis () {
134150 return this ;
@@ -188,10 +204,24 @@ public Builder setInbox(Object inbox) {
188204 return this ;
189205 }
190206
207+ public Builder setLargeIcon (String largeIcon ) {
208+ this .large_icon = largeIcon ;
209+ return this ;
210+ }
211+
212+ public Builder setIntent (JsonObject intent ) {
213+ if (null == inbox ) {
214+ LOG .warn ("Null intent. Throw away it." );
215+ return this ;
216+ }
217+ this .intent = intent ;
218+ return this ;
219+ }
220+
191221
192222 public AndroidNotification build () {
193223 return new AndroidNotification (alert , title , builderId , style , alert_type , big_text , inbox , big_pic_path , priority ,
194- category , extrasBuilder , numberExtrasBuilder , booleanExtrasBuilder , jsonExtrasBuilder );
224+ category , large_icon , intent , extrasBuilder , numberExtrasBuilder , booleanExtrasBuilder , jsonExtrasBuilder );
195225 }
196226 }
197227}
0 commit comments