src/Mcfedr/AwsPushBundle/Service/Messages.php
public function send($message, string $endpointArn)
    {
        if ($this->debug) {
            $this->logger && $this->logger->notice(
                "Message would have been sent to $endpointArn",
                [
                    'Message' => $message,
                ]
            );

            return;
        }

        if (!($message instanceof Message)) {
            $message = new Message($message);
        }

        $this->sns->publish(
            [
                'TargetArn' => $endpointArn,
                'Message' => $this->encodeMessage($message),
                'MessageStructure' => 'json',
            ]
        );
    }
public function send($message, string $endpointArn)
    {
        if ($this->debug) {
            $this->logger && $this->logger->notice(
                "Message would have been sent to $endpointArn",
                [
                    'Message' => $message,
                ]
            );

            return;
        }

        if (!($message instanceof Message)) {
            $message = new Message($message);
        }

        $this->sns->publish(
            [
                'TargetArn' => $endpointArn,
                'Message' => $this->encodeMessage($message),
                'MessageStructure' => 'json',
            ]
        );
    }
public function send ( $ message , string $ endpointArn ) { if ( $ this -> debug ) { $ this -> logger && $ this -> logger -> notice ( "Message would have been sent to $endpointArn" , [ 'Message' => $ message , ] ) ; return ; } if ( ! ( $ message instanceof Message ) ) { $ message = new Message ( $ message ) ; } $ this -> sns -> publish ( [ 'TargetArn' => $ endpointArn , 'Message' => $ this -> encodeMessage ( $ message ) , 'MessageStructure' => 'json' , ] ) ; }
Send a message to an endpoint.

@param Message|string $message
@param string         $endpointArn

@throws MessageTooLongException
Send a message to an endpoint .