Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2.     $oneSignalHeader = array('Content-Type' => 'application/json; charset=utf-8',
  3.                                  'Authorization' => 'Basic'.$KEY);
  4.     $content = array(
  5.         "en" => "제목"
  6.     );
  7.     $headings = array(
  8.         "en" => "내용"
  9.     );
  10.     $fields = array(
  11.         'app_id' => "e65616cf-e050-438c-8512-418e257ab4e6",
  12.         'include_player_ids' => array('0d1d74d4-12a4-43bb-b66f-5e58e6664f88'),
  13.         'contents' => $content,
  14.         'headings' => $headings,
  15.     );
  16.     $fields = json_encode($fields);
  17.     $response = Requests::post("https://onesignal.com/api/v1/notifications", $oneSignalHeader, $fields);
  18.     $ret = json_decode($response->body);
  19.     var_dump($ret);
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement