public function createMessage($deviceTokens = [])
    {
        $message = new Message();
        if (is_string($deviceTokens)) {
            $deviceTokens = [$deviceTokens];
        }
        if (!is_array($deviceTokens)) {
            throw new InvalidParamException("\$deviceTokens must be string or array");
        }
        foreach ($deviceTokens as $token) {
            $message->addRecipient($this->createDevice($token));
        }
        return $message;
    }
public function createMessage($deviceTokens = [])
    {
        $message = new Message();
        if (is_string($deviceTokens)) {
            $deviceTokens = [$deviceTokens];
        }
        if (!is_array($deviceTokens)) {
            throw new InvalidParamException("\$deviceTokens must be string or array");
        }
        foreach ($deviceTokens as $token) {
            $message->addRecipient($this->createDevice($token));
        }
        return $message;
    }
public function createMessage ( $ deviceTokens = [ ] ) { $ message = new Message ( ) ; if ( is_string ( $ deviceTokens ) ) { $ deviceTokens = [ $ deviceTokens ] ; } if ( ! is_array ( $ deviceTokens ) ) { throw new InvalidParamException ( "\$deviceTokens must be string or array" ) ; } foreach ( $ deviceTokens as $ token ) { $ message -> addRecipient ( $ this -> createDevice ( $ token ) ) ; } return $ message ; }
Creates Message object
@param string[]|string $deviceTokens tokens of recipient devices
@return Message
Creates Message object