mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Clean up push metadata
빈 값은 제외하고 전송하도록 보완합니다. 즉, 기존에 세팅된 값을 제거하려면 빈 값을 세팅하면 됩니다.
This commit is contained in:
parent
5bbda4b532
commit
9d6e54f2f6
2 changed files with 5 additions and 3 deletions
|
|
@ -59,7 +59,7 @@ class FCM extends Base implements \Rhymix\Framework\Drivers\PushInterface
|
|||
);
|
||||
|
||||
// Set notification
|
||||
$notification = $message->getNotifications() ?? [];
|
||||
$notification = $message->getMetadata();
|
||||
$notification['title'] = $message->getSubject();
|
||||
$notification['body'] = $message->getContent();
|
||||
|
||||
|
|
|
|||
|
|
@ -296,9 +296,11 @@ class Push
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getNotifications(): array
|
||||
public function getMetadata(): array
|
||||
{
|
||||
return $this->metadata;
|
||||
return array_filter($this->metadata, function($val) {
|
||||
return $val !== '';
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue