paragraph1\phpFCM\Notification::jsonSerialize PHP Method

jsonSerialize() public method

public jsonSerialize ( )
    public function jsonSerialize()
    {
        $jsonData = array();
        if ($this->title) {
            $jsonData['title'] = $this->title;
        }
        $jsonData['body'] = $this->body;
        if ($this->badge) {
            $jsonData['badge'] = $this->badge;
        }
        if ($this->icon) {
            $jsonData['icon'] = $this->icon;
        }
        if ($this->clickAction) {
            $jsonData['click_action'] = $this->clickAction;
        }
        if ($this->sound) {
            $jsonData['sound'] = $this->sound;
        }
        if ($this->color) {
            $jsonData['color'] = $this->color;
        }
        if ($this->tag) {
            $jsonData['tag'] = $this->tag;
        }
        return $jsonData;
    }