Skip to content

Commit

Permalink
Merged in android_channel_id pull request from rayansys
Browse files Browse the repository at this point in the history
  • Loading branch information
rolinger committed Sep 5, 2024
1 parent adbfdc0 commit 00423cf
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/Push/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ class Notification implements Request
* @var string|null
*/
private $image_url;


/**
* @var string
*/
private $android_channel_id;

/**
* @param string $title
* @param string $body
* @param string $recipient
*/
public function __construct(string $title = '', string $body = '', string $recipient = '', string $sound = '', string $icon = '', string $color = '', int $badge = 0, string $tag = '', string $subtitle = '', array $data = [], string $click_action = '', string $image_url = null)
public function __construct(string $title = '', string $body = '', string $recipient = '', string $sound = '', string $icon = '', string $color = '', int $badge = 0, string $tag = '', string $subtitle = '', array $data = [], string $click_action = '', string $image_url = null , string $android_channel_id = "")
{
$this->title = $title;
$this->body = $body;
Expand All @@ -79,6 +85,7 @@ public function __construct(string $title = '', string $body = '', string $recip
if (!empty($click_action)) {
$this->click_action = $click_action;
}
$this->android_channel_id = $android_channel_id;

if (!empty($data)) {
$this->data = $data;
Expand Down Expand Up @@ -196,6 +203,18 @@ public function setClickAction(string $click_action): self {
return $this;
}

/**
* @param string $android_channel_id
*
* @return $this
*/
public function setAndroidChannelID(string $android_channel_id): self
{
$this->android_channel_id = $android_channel_id;

return $this;
}

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -245,6 +264,8 @@ public function getBody(): array
if ($this->badge>0) {
$request['notification']['badge'] = $this->badge;
}
if($this->android_channel_id != "")
$request['notification']['android_channel_id'] = $this->android_channel_id;

if (!empty($this->click_action)) {
$request['notification']['click_action'] = $this->click_action;
Expand Down

0 comments on commit 00423cf

Please sign in to comment.