/** * @param array $fields */ public function editAppById($fields = []) { if (null !== $this->authConfig->appId && null !== $this->authConfig->authKey) { if (is_array($fields)) { $fields = json_encode($fields); $app = Curl::curlPut(Constant::ONESIGNAL_URL . '/apps/' . $this->authConfig->appId, $this->authConfig->authKey, $fields); return json_decode($app); } else { throw $this->createNotFoundException('editAppById parameters must be an array'); } } else { throw $this->createNotFoundException('Sorry App Id or Auth Key missing'); } }
/** * @param $notificationId */ public function removeNotificationById($notificationId) { if (null !== $this->authConfig->restApiKey && null !== $this->authConfig->appId) { if (isset($notificationId)) { $notifications = Curl::curlDelete(Constant::ONESIGNAL_URL . '/notifications/' . $notificationId . '/?app_id=' . $this->authConfig->appId, $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'); } }
public function createPlayerCsvExport() { if (null !== $this->authConfig->restApiKey && null !== $this->authConfig->appId) { $players = Curl::curlPost(Constant::ONESIGNAL_URL . '/players/csv_export?app_id=' . $this->authConfig->appId, $this->authConfig->restApiKey); return json_decode($players); } else { return 'Sorry you need the App Id'; } }