From 93a2b330c16d32640b656a6808eb5b7baa4d4637 Mon Sep 17 00:00:00 2001 From: berkayk Date: Wed, 4 May 2016 12:13:53 +0300 Subject: [PATCH] Updated customMethod to include app_id and segment by default. --- src/OneSignalClient.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/OneSignalClient.php b/src/OneSignalClient.php index 5ed2e9a..c0dd097 100644 --- a/src/OneSignalClient.php +++ b/src/OneSignalClient.php @@ -110,6 +110,15 @@ public function sendNotificationToSegment($message, $segment, $url = null, $data public function sendNotificationCustom($parameters = []){ $this->requiresAuth(); $this->usesJSON(); + + // Make sure to use app_id + $parameters['app_id'] = $this->appId; + + // Make sure to use included_segments + if (empty($parameters['included_segments']) && empty($parameters['include_player_ids'])) { + $parameters['included_segments'] = ['all']; + } + $this->headers['body'] = json_encode($parameters); $this->headers['verify'] = false; return $this->post("notifications");