Ejemplo n.º 1
0
 /**
  * @param Message $message
  * @param RecipientInterface|AppleDeviceRecipient $recipient
  * @codeCoverageIgnore
  */
 public function send(Message $message, RecipientInterface $recipient)
 {
     $appleMessage = new AppleMessage();
     $appleMessage->setBody((string) $message->getBody());
     $appleMessage->setDeviceToken($recipient->getToken());
     $appleMessage->setCustomData($message->getExtra());
     $notification = new Notification($this->connection);
     $notification->send($appleMessage);
 }
Ejemplo n.º 2
0
 /**
  * @param Message $message
  * @param RecipientInterface $recipient
  * @codeCoverageIgnore
  */
 public function send(Message $message, RecipientInterface $recipient)
 {
     $randomCollapse = rand(11, 100);
     $gcmMessage = new GcmMessage("{$randomCollapse}", ['message' => (string) $message->getBody(), 'title', (string) $message->getTitle()]);
     $extra = $message->getExtra();
     foreach ($extra as $key => $value) {
         $gcmMessage->addData($key, $value);
     }
     $this->sender->sendMulti($gcmMessage, [$recipient->getToken()], $this->retries);
 }
Ejemplo n.º 3
0
 /**
  * @param Message $message
  * @param RecipientInterface|WindowsDeviceRecipient $recipient
  * @codeCoverageIgnore
  */
 public function send(Message $message, RecipientInterface $recipient)
 {
     $this->connection->pushToast($recipient->getToken(), (string) $message->getTitle(), (string) $message->getBody());
 }