Skip to content

Commit 95665f6

Browse files
authored
Merge pull request #5 from redjanym/develop
Add custom color for android devices
2 parents f362f09 + de292f1 commit 95665f6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Notification.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)