Skip to content

Commit

Permalink
Updated customMethod to include app_id and segment by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
berkayk committed May 4, 2016
1 parent 568fa32 commit 93a2b33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/OneSignalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 93a2b33

Please sign in to comment.