/** * executeNotificato */ protected function executeNotificato() { $message = $this->input->getArgument('message'); $device = $this->input->getArgument('device'); $pushNotification = $this->notificato->messageBuilder()->setDeviceToken($device)->setBadge(1)->setAlert('The message is: ' . $message)->build(); $messageEnvelope = $this->notificato->send($pushNotification); $this->output->writeln($messageEnvelope->getFinalStatusDescription()); }
function clean() { $notificato = new Notificato(getenv('IOS_PUSH_CERTIFICATE'), getenv('IOS_PUSH_PASSPHRASE'), false, getenv('IOS_PUSH_ENVIRONMENT')); $tuples = $notificato->receiveFeedback(); foreach ($tuples as $tuple) { $InvalidatedAt = $tuple->getInvalidatedAt()->getTimestamp(); $token = $tuple->getDeviceToken(); if ($InvalidatedAt > strtotime($this->tokens[$token])) { if (($key = array_search($token, $this->results[static::UNKNOWN])) !== false) { unset($this->results[static::UNKNOWN][$key]); } $this->add(static::INVALID, $token); } } $this->cleanDB(); }