Skip to content

RoomRequest

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



RoomRequest(token, context, roomName, roomCallEventListener)

Description

Creates an instance of RoomRequest required for making a room call via joinRoom method.

Arguments

  • token: String - Authentication token generated by client's app via Infobip's HTTP /webrtc/1/token endpoint.
  • context: Context - An instance of the android.content.Context class, which provides access to system services, resources, and application-specific data in an Android application.
  • roomName: String - Name of the room which user wants to join.
  • roomCallEventListener: RoomCallEventListener - Event listener used for receiving room events.

Returns

Example

RoomRequest roomRequest = new RoomRequest(
        obtainToken(),
        getApplicationContext(),
        new DefaultRoomCallEventListener() {
            @Override
            public void onRoomJoined(RoomJoinedEvent roomJoinedEvent) {
                Toast.makeText(getApplicationContext(), "Room joined!", Toast.LENGTH_LONG);
            }

            @Override
            public void onParticipantJoined(ParticipantJoinedEvent participantJoinedEvent) {
                Toast.makeText(getApplicationContext(), "Participant joined!", Toast.LENGTH_LONG);
            }

            @Override
            public void onParticipantLeft(ParticipantLeftEvent participantLeftEvent) {
                Toast.makeText(getApplicationContext(), "Participant left!", Toast.LENGTH_LONG);
            }

            @Override
            public void onRoomLeft(RoomLeftEvent roomLeftEvent) {
                Toast.makeText(getApplicationContext(), "Room left!", Toast.LENGTH_LONG);
            }
        },
        "room-test"
);



getToken()

Description

Getter for the token field.

Arguments

  • none

Returns

  • String - The value of the token field, which represents the authentication token provided in the request.

Example

String token = roomRequest.getToken();



getContext()

Description

Getter for the context field.

Arguments

  • none

Returns

  • Context - The value of the context field, which represents the Android context provided in the request.

Example

Context context = roomRequest.getContext();



getRoomName()

Description

Getter for the roomName field.

Arguments

  • none

Returns

  • String - The value of the roomName field, which represents the name of the room provided in the request.

Example

String roomName = roomRequest.getRoomName();



getRoomCallEventListener()

Description

Getter for the roomCallEventListener field.

Arguments

  • none

Returns

  • RoomCallEventListener - The value of the roomCallEventListener field, which represents interface to be implemented, provided in the request.

Example

RoomCallEventListener roomCallEventListener = roomRequest.getRoomCallEventListener();

Tutorials

Migration guides

Reference documentation

Clone this wiki locally