File tree 1 file changed +16
-0
lines changed
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
10
10
private $ body ;
11
11
private $ badge ;
12
12
private $ icon ;
13
+ private $ color ;
13
14
private $ sound ;
14
15
private $ clickAction ;
15
16
private $ tag ;
@@ -58,6 +59,18 @@ public function setIcon($icon)
58
59
$ this ->icon = $ icon ;
59
60
return $ this ;
60
61
}
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
+ }
61
74
62
75
public function setClickAction ($ actionName )
63
76
{
@@ -97,6 +110,9 @@ public function jsonSerialize()
97
110
if ($ this ->icon ) {
98
111
$ jsonData ['icon ' ] = $ this ->icon ;
99
112
}
113
+ if ($ this ->color ) {
114
+ $ jsonData ['color ' ] = $ this ->color ;
115
+ }
100
116
if ($ this ->clickAction ) {
101
117
$ jsonData ['click_action ' ] = $ this ->clickAction ;
102
118
}
You can’t perform that action at this time.
0 commit comments