From f89493454af658b2bcfcf29aef674ac86a380bf5 Mon Sep 17 00:00:00 2001 From: Omid Khadem Date: Wed, 26 Oct 2016 12:55:37 +0330 Subject: [PATCH 1/2] fixed an issue with notification type --- src/Client.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index 61f7fe3..f6e8fc3 100644 --- a/src/Client.php +++ b/src/Client.php @@ -77,9 +77,7 @@ public function send($data, array $registrationIds = array(), array $options = a { $this->responses = array(); - $data = array_merge($options, array( - 'data' => $data, - )); + $data = !empty($data) ? array_merge($options, array('data' => $data)) : array(); if (isset($options['to'])) { $this->responses[] = $this->browser->post($this->apiUrl, $this->getHeaders(), json_encode($data)); From 211d6ca59c2b5c2f3e11dde7dae87da3664c137f Mon Sep 17 00:00:00 2001 From: Omid Khadem Date: Wed, 26 Oct 2016 12:57:20 +0330 Subject: [PATCH 2/2] setting $options as default value of $data variable --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index f6e8fc3..de46c06 100644 --- a/src/Client.php +++ b/src/Client.php @@ -77,7 +77,7 @@ public function send($data, array $registrationIds = array(), array $options = a { $this->responses = array(); - $data = !empty($data) ? array_merge($options, array('data' => $data)) : array(); + $data = !empty($data) ? array_merge($options, array('data' => $data)) : $options; if (isset($options['to'])) { $this->responses[] = $this->browser->post($this->apiUrl, $this->getHeaders(), json_encode($data));