php-firebase-cloud-messaging icon indicating copy to clipboard operation
php-firebase-cloud-messaging copied to clipboard

Body of notification not sent

Open clindh opened this issue 8 years ago • 1 comments

In Notification::jsonSerialize there is an error, causing "body" not to be added to jsonData if there is no title set

public function jsonSerialize()
    {
...
        if ($this->title) {
            $jsonData['body'] = $this->body;
        }

clindh avatar Nov 17 '16 23:11 clindh

Hi I'll think it's because you have the same test for title and body, a PR will be here if you want :)

https://github.com/sngrl/php-firebase-cloud-messaging/pull/13

johann59 avatar Nov 18 '16 00:11 johann59