From 1fc2e3302df17b2f627063d0f6e2841218133f98 Mon Sep 17 00:00:00 2001 From: irakli Date: Fri, 12 Apr 2019 17:09:50 +0400 Subject: [PATCH] add andoid channel id support --- src/Notification.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Notification.php b/src/Notification.php index 812444d..6b947cd 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -86,6 +86,20 @@ public function setColor($color) return $this; } + /** + * android only: urgent notification display + * + * @param int $id + * + * @return \paragraph1\phpFCM\Notification + */ + public function setAndroidChannelId($id) + { + $this->android_channel_id = $id; + return $this; + } + + /** * android/ios: what should happen upon notification click. when empty on android the default activity * will be launched passing any payload to an intent. @@ -156,6 +170,9 @@ public function jsonSerialize() if ($this->tag) { $jsonData['tag'] = $this->tag; } + if ($this->android_channel_id) { + $jsonData['android_channel_id'] = $this->android_channel_id; + } return $jsonData; }