Skip to content

Commit

Permalink
Update NotificationMessage.php
Browse files Browse the repository at this point in the history
  • Loading branch information
619096932 authored Jan 19, 2021
1 parent 9d949e5 commit a0babd1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Message/NotificationMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
}

public function setChannelLevel(int $Level = 4)
{
$this->data['channel_level'] = $Level;

return $this;
}
}

0 comments on commit a0babd1

Please sign in to comment.