public function sendSms($toNumber, $message)
    {
        if (empty($this->has_sms)) {
            throw new Exceptions\NoSmsException("Device cannot send SMS messages.");
        }

        $data = [
            'type' => 'push',
            'push' => [
                'type'               => 'messaging_extension_reply',
                'package_name'       => 'com.pushbullet.android',
                'source_user_iden'   => (new Pushbullet($this->apiKey))->getUserInformation()->iden,
                'target_device_iden' => $this->iden,
                'conversation_iden'  => $toNumber,
                'message'            => $message
            ]
        ];

        return new Push(
            Connection::sendCurlRequest(Connection::URL_EPHEMERALS, 'POST', $data, true, $this->apiKey),
            $this->apiKey
        );
    }
public function sendSms($toNumber, $message)
    {
        if (empty($this->has_sms)) {
            throw new Exceptions\NoSmsException("Device cannot send SMS messages.");
        }

        $data = [
            'type' => 'push',
            'push' => [
                'type'               => 'messaging_extension_reply',
                'package_name'       => 'com.pushbullet.android',
                'source_user_iden'   => (new Pushbullet($this->apiKey))->getUserInformation()->iden,
                'target_device_iden' => $this->iden,
                'conversation_iden'  => $toNumber,
                'message'            => $message
            ]
        ];

        return new Push(
            Connection::sendCurlRequest(Connection::URL_EPHEMERALS, 'POST', $data, true, $this->apiKey),
            $this->apiKey
        );
    }
public function sendSms ( $ toNumber , $ message ) { if ( empty ( $ this -> has_sms ) ) { throw new Exceptions \ NoSmsException ( "Device cannot send SMS messages." ) ; } $ data = [ 'type' => 'push' , 'push' => [ 'type' => 'messaging_extension_reply' , 'package_name' => 'com.pushbullet.android' , 'source_user_iden' => ( new Pushbullet ( $ this -> apiKey ) ) -> getUserInformation ( ) -> iden , 'target_device_iden' => $ this -> iden , 'conversation_iden' => $ toNumber , 'message' => $ message ] ] ; return new Push ( Connection :: sendCurlRequest ( Connection :: URL_EPHEMERALS , 'POST' , $ data , true , $ this -> apiKey ) , $ this -> apiKey ) ; }
Send an SMS message from the device.

@param string $toNumber Phone number of the recipient.
@param string $message  Text of the message.

@return Push
@throws Exceptions\ConnectionException
@throws Exceptions\NoSmsException Thrown if the device cannot send SMS messages.
Send an SMS message from the device .