Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
afiqiqmal committed Nov 13, 2020
1 parent 524ed62 commit 8f4947b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Structure/Android/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Config implements Extras
*
* @var int
*/
protected $urgency;
protected $urgency = 3;

/**
* Scenario where a high-priority data message is sent. The options are as follows:
Expand Down Expand Up @@ -178,13 +178,13 @@ public function toArray()
{
return [
'collapse_key' => $this->collapse_state,
'urgency' => self::$urgencyName[$this->urgency],
'category' => self::$categoryName[$this->category],
'urgency' => self::$urgencyName[$this->urgency] ?? null,
'category' => self::$categoryName[$this->category] ?? null,
'ttl' => "{$this->timeToLive}s",
'bi_tag' => $this->tags,
'fast_app_target' => $this->staging ? 1 : 2,
'data' => $this->data,
'notification' => $this->notification->toArray(),
'notification' => $this->notification ? $this->notification->toArray() : null,
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Structure/Android/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ public function toArray()
'use_default_vibrate' => $this->use_default_vibrate,
'use_default_light' => $this->use_default_light,
'vibrate_config' => $this->vibrate_config,
'visibility' => self::$visibilityName[$this->visibility],
'visibility' => self::$visibilityName[$this->visibility] ?? null,
'light_settings' => $this->light_settings ? $this->light_settings->toArray() : null,
'foreground_show' => $this->foreground_show,
'profile_id' => $this->profile_id,
Expand Down
7 changes: 3 additions & 4 deletions src/Structure/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,9 @@ public function setCondition(string $condition)
public function toArray()
{
return [
'notification' => $this->notification->toArray() ?? null,
'android' => $this->android->toArray() ?? null,
// 'apns' => $this->apns->toArray() ?? null,
// 'webpush' => $this->webpush->toArray() ?? null,
'data' => $this->data ?? null,
'notification' => $this->notification ? $this->notification->toArray() : null,
'android' => $this->android ? $this->android->toArray() : null,
'token' => $this->targetDeviceIds,
'condition' => $this->condition,
'topic' => $this->topic,
Expand Down

0 comments on commit 8f4947b

Please sign in to comment.