Skip to content

SendTextListener

Lejla Solak edited this page Feb 10, 2025 · 2 revisions



onSendSuccess(id)

Description

This callback method is triggered when sending text was successful.

Arguments

  • id: String - The value representing a unique text identifier.

Returns

  • N/A

Example

SendTextListener sendTextListener = new SendTextListener() {
    @Override
    public void onSendSuccess(String id) {
        Log.d("WebRTC", String.format("Successfully sent text with id: %s", id));
    }

    @Override
    public void onSendFailure(ErrorCode errorCode) {
    }
}



onSendFailure(errorCode)

Description

This callback method is triggered when sending text failed with an error.

Arguments

  • errorCode: ErrorCode - Object containing the reason why sending text has failed.

Returns

  • N/A

Example

SendTextListener sendTextListener = new SendTextListener() {
    @Override
    public void onSendSuccess(String id) {
    }

    @Override
    public void onSendFailure(ErrorCode errorCode) {
        Log.e("WebRTC", String.format("Error occurred when sending message: %s.", errorCode.getDescription()));
    }
}

Tutorials

Migration guides

Reference documentation

Clone this wiki locally