File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class Notification extends Message
1010 private $ body ;
1111 private $ badge ;
1212 private $ icon ;
13+ private $ color ;
1314 private $ sound ;
1415 private $ clickAction ;
1516 private $ tag ;
@@ -58,6 +59,18 @@ public function setIcon($icon)
5859 $ this ->icon = $ icon ;
5960 return $ this ;
6061 }
62+
63+ /**
64+ * android only, set the color background resource as string
65+ *
66+ * @param string $color
67+ * @return $this
68+ */
69+ public function setColor ($ color )
70+ {
71+ $ this ->color = $ color ;
72+ return $ this ;
73+ }
6174
6275 public function setClickAction ($ actionName )
6376 {
@@ -97,6 +110,9 @@ public function jsonSerialize()
97110 if ($ this ->icon ) {
98111 $ jsonData ['icon ' ] = $ this ->icon ;
99112 }
113+ if ($ this ->color ) {
114+ $ jsonData ['color ' ] = $ this ->color ;
115+ }
100116 if ($ this ->clickAction ) {
101117 $ jsonData ['click_action ' ] = $ this ->clickAction ;
102118 }
You can’t perform that action at this time.
0 commit comments