diff --git a/src/Message/NotificationMessage.php b/src/Message/NotificationMessage.php index 0eff4a6..22f1cd1 100644 --- a/src/Message/NotificationMessage.php +++ b/src/Message/NotificationMessage.php @@ -11,14 +11,14 @@ */ class NotificationMessage implements MessageInterface { - public function toArray():array + public function toArray(): array { $data = $this->data; $data['payload'] = json_encode($data['payload']); - return ['notification'=>$data]; + return ['notification' => $data]; } protected $data = [ - 'click_type'=>'payload' + 'click_type' => 'payload' ]; public function setTitle(string $title) { @@ -50,7 +50,14 @@ public function setClickType(string $clickType) */ public function setPayload(array $payload) { - $this->data['payload'] = array_merge($this->data['payload'],$payload); + $this->data['payload'] = array_merge($this->data['payload'], $payload); return $this; } -} \ No newline at end of file + + public function setChannelLevel(int $Level = 4) + { + $this->data['channel_level'] = $Level; + + return $this; + } +}