RMS\PushNotificationsBundle\Service\OS\BlackberryNotification::constructMessageBody PHP Method

constructMessageBody() protected method

Builds the actual body of the message
protected constructMessageBody ( RMS\PushNotificationsBundle\Message\BlackberryMessage $message, $separator ) : string
$message RMS\PushNotificationsBundle\Message\BlackberryMessage
$separator
return string
    protected function constructMessageBody(BlackberryMessage $message, $separator)
    {
        $data = "";
        $messageID = microtime(true);
        $data .= "--" . $separator . "\r\n";
        $data .= "Content-Type: application/xml; charset=UTF-8\r\n\r\n";
        $data .= $this->getXMLBody($message, $messageID) . "\r\n";
        $data .= "--" . $separator . "\r\n";
        $data .= "Content-Type: text/plain\r\n";
        $data .= "Push-Message-ID: {$messageID}\r\n\r\n";
        if (is_array($message->getMessageBody())) {
            $data .= json_encode($message->getMessageBody());
        } else {
            $data .= $message->getMessageBody();
        }
        $data .= "\r\n";
        $data .= "--" . $separator . "--\r\n";
        return $data;
    }