Skip to content

Commit 543f042

Browse files
committed
Fixed app_id bug in parameters.
1 parent d682a5b commit 543f042

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/OneSignalClient.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ class OneSignalClient
1111
const ENDPOINT_NOTIFICATIONS = "/notifications";
1212
const ENDPOINT_PLAYERS = "/players";
1313

14-
private $client;
15-
private $headers;
16-
private $appId;
17-
private $restApiKey;
18-
private $userAuthKey;
19-
private $additionalParams;
14+
protected $client;
15+
protected $headers;
16+
protected $appId;
17+
protected $restApiKey;
18+
protected $userAuthKey;
19+
protected $additionalParams;
2020

2121
/**
2222
* @var bool
@@ -217,12 +217,13 @@ public function sendNotificationToSegment($message, $segment, $url = null, $data
217217
public function sendNotificationCustom($parameters = []){
218218
$this->requiresAuth();
219219
$this->usesJSON();
220-
// By Sucipto
220+
221221
if (isset($parameters['api_key'])) {
222222
$this->headers['headers']['Authorization'] = 'Basic '.$parameters['api_key'];
223223
}
224+
224225
// Make sure to use app_id
225-
if (!$parameters['app_id']) {
226+
if (!isset($parameters['app_id'])) {
226227
$parameters['app_id'] = $this->appId;
227228
}
228229

0 commit comments

Comments
 (0)