Skip to content

Commit 4af5b6d

Browse files
committed
get the returned body and json encode it
1 parent aaea943 commit 4af5b6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/OneSignalClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function sendNotificationToUserByEmail(
259259
$filters = [["field" => "email", "value" => $email]];
260260
}
261261

262-
$this->sendNotificationToFiltersToSegment($message, $filters, $segment, $url, $data, $buttons, $schedule,
262+
return $this->sendNotificationToFiltersToSegment($message, $filters, $segment, $url, $data, $buttons, $schedule,
263263
$smallIcon, $LargeIcon, $bigPicture, $androidAccentCircleColor, $androidAccentLedColor, $sound);
264264
}
265265

@@ -327,7 +327,7 @@ public function sendNotificationToFiltersToSegment(
327327
$params['android_sound'] = $sound;
328328
}
329329

330-
$this->sendNotificationCustom($params);
330+
return $this->sendNotificationCustom($params);
331331
}
332332

333333
/**
@@ -356,13 +356,13 @@ public function sendNotificationCustom($parameters = [])
356356
$parameters['included_segments'] = ['all'];
357357
}
358358
$parameters = array_merge($parameters, $this->additionalParams);
359-
\Log::alert('from OneSignal', $parameters);
359+
// \Log::alert('from OneSignal', $parameters);
360360

361361
$this->headers['body'] = json_encode($parameters);
362362
$this->headers['buttons'] = json_encode($parameters);
363363
$this->headers['verify'] = false;
364364

365-
return $this->post(self::ENDPOINT_NOTIFICATIONS);
365+
return json_decode($this->post(self::ENDPOINT_NOTIFICATIONS)->getBody()->getContents());
366366
}
367367

368368
/**

0 commit comments

Comments
 (0)