From 06e3a5ed5cf7d30bdf41a8a481ae43e3a84c9f20 Mon Sep 17 00:00:00 2001 From: peggy Date: Wed, 26 Feb 2020 11:01:15 +0800 Subject: [PATCH 1/2] [fix] fix syntax --- src/OneSignalClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OneSignalClient.php b/src/OneSignalClient.php index 4d600c6..7d202f3 100644 --- a/src/OneSignalClient.php +++ b/src/OneSignalClient.php @@ -420,7 +420,7 @@ public function getNotifications($app_id = null, $limit = null, $offset = null) } if($offset) { - $endpoint.="&offset=".$$offset; + $endpoint.="&offset=".$offset; } return $this->get($endpoint); From 93391443294d9a08498caacbfa199ae9fce6fb4f Mon Sep 17 00:00:00 2001 From: peggy Date: Wed, 26 Feb 2020 11:07:18 +0800 Subject: [PATCH 2/2] [feat] add get notifications parameter --- src/OneSignalClient.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OneSignalClient.php b/src/OneSignalClient.php index 7d202f3..198b6a1 100644 --- a/src/OneSignalClient.php +++ b/src/OneSignalClient.php @@ -403,7 +403,7 @@ public function getNotification($notification_id, $app_id = null) { return $this->get(self::ENDPOINT_NOTIFICATIONS . '/'.$notification_id . '?app_id='.$app_id); } - public function getNotifications($app_id = null, $limit = null, $offset = null) { + public function getNotifications($app_id = null, $limit = null, $offset = null, $kind = null) { $this->requiresAuth(); $this->usesJSON(); @@ -423,6 +423,10 @@ public function getNotifications($app_id = null, $limit = null, $offset = null) $endpoint.="&offset=".$offset; } + if ($kind) { + $endpoint.="&kind=".$kind; + } + return $this->get($endpoint); }