Skip to content

Commit

Permalink
Merge pull request #41 from masucip/patch-1
Browse files Browse the repository at this point in the history
Add Multi App with api_key parameter
  • Loading branch information
berkayk authored Sep 5, 2017
2 parents 340bf8c + 0b2ff8c commit 7fc126d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/OneSignalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,14 @@ public function sendNotificationToSegment($message, $segment, $url = null, $data
public function sendNotificationCustom($parameters = []){
$this->requiresAuth();
$this->usesJSON();

// By Sucipto
if ($parameters['api_key']) {
$this->headers['headers']['Authorization'] = 'Basic '.$parameters['api_key'];
}
// Make sure to use app_id
$parameters['app_id'] = $this->appId;
if (!$parameters['app_id']) {
$parameters['app_id'] = $this->appId;
}

// Make sure to use included_segments
if (empty($parameters['included_segments']) && empty($parameters['include_player_ids'])) {
Expand Down

0 comments on commit 7fc126d

Please sign in to comment.