예제 #1
0
 /**
  *
  */
 public function getAppById()
 {
     if (null !== $this->authConfig->appId && null !== $this->authConfig->authKey) {
         $appId = Curl::curlGet(Constant::ONESIGNAL_URL . '/apps/' . $this->authConfig->appId, $this->authConfig->authKey);
         return json_decode($appId);
     } else {
         throw $this->createNotFoundException('Sorry app id or auth key missing');
     }
 }
예제 #2
0
 public function getPlayerDevicesById($playersId)
 {
     if (isset($playersId)) {
         $players = Curl::curlGet(Constant::ONESIGNAL_URL . '/players/' . $playersId);
         return json_decode($players);
     } else {
         throw $this->createNotFoundException('Sorry players Id missing');
     }
 }
 /**
  * @param $notificationId
  * @param int $limit
  * @param int $offset
  */
 public function getNotificationById($notificationId, $limit = 50, $offset = 0)
 {
     if (null !== $this->authConfig->restApiKey && null !== $this->authConfig->appId) {
         if (isset($notificationId)) {
             $notifications = Curl::curlGet(Constant::ONESIGNAL_URL . '/notifications/' . $notificationId . '/?app_id=' . $this->authConfig->appId . '&limit=' . $limit . '&offset=' . $offset, $this->authConfig->restApiKey);
             return json_decode($notifications);
         } else {
             throw $this->createNotFoundException('Sorry notification id missing');
         }
     } else {
         throw $this->createNotFoundException('Sorry App id or Rest Api Key missing, check up your config file');
     }
 }