/** * @param Message|MessageInterface $message * @return Response * @throws \Exception */ public function send(MessageInterface $message) { if (!$message instanceof Message) { throw new \Exception("Receivers should be list od APNS devices"); } $this->connect(); $data = $message->json(); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $data); $result = Response::fromCurl($this->curl); return $result; }