Delete a room
Update time: 2023/05/11 09:30:38
This topic describes how to delete a room in NERoom SDK. After the room is deleted, all members in the room are removed from the room.
Considerations
- Rooms for live battles can survive for a maximum of 24 hours. The NERoom Server will automatically delete the rooms after 24 hours.
- In other scenarios, a room can survive for a maximum of 16 hours. The NERoom Server will automatically delete the room.
- To extend the default lifetime of a room, contact sales.
- You can configure whether a role has the permission to delete a room in the CommsEase console. Only roles with this permission can delete rooms.
How it works
When a member delete a room, NERoom Server checks whether the member role has permissions for the operation based on the template ID and role ID. For example, if a member with a role ID of host deletes a room member, the following work flow verifies the required permissions.
Procedure
- Get the room context by calling
getRoomContext. Set roomUuid to the ID of the room you want to join. - Delete the room by calling the
endRoominterface.
kt fun endRoom(callback: NECallback<Unit>)
- After the room is deleted, the
onRoomEndedcallback method in theNERoomListenerprotocol will be triggered.
- Example
Sample code for deleting a room:
ktNERoomService roomService = NERoomKit.getInstance().getService(NERoomService.class);
NERoomContext roomContext = roomService.getRoomContext(roomUuid);
if (roomContext!=null){
roomContext.endRoom(new NECallback2<Unit>() {
@Override
public void onSuccess(@Nullable Unit unit) {
super.onSuccess(unit);
Log.d(TAG,"success");
}
@Override
public void onError(int code, @Nullable String message) {
super.onError(code, message);
Log.d(TAG,"error");
}
});
}
API reference
| Method | Description |
|---|---|
endRoom |
Delete a room. |
Was this page helpful?





