Breaking Changes and Migration Guide
This section provides details about the additional breaking changes made in Dyte Core SDK v2 and provides migration guidance. The changes span multiple modules, mainly simplifying the APIs or renaming them to ensure uniformity across the platforms.
Changes in Participant Hierarchy and Simplified Types
The participant hierarchy has been simplified to align better with real-world entities:
- 
Old Structure:
DyteMeetingParticipantwas the parent class with direct subtypes:DyteJoinedMeetingParticipantDyteWaitlistedParticipant
DyteJoinedMeetingParticipanthad two subtypes:DyteScreenShareMeetingParticipantDyteSelfParticipant(local user)
 - 
New Structure:
DyteMeetingParticipantstill represents a participant in a meeting which is simply either:DyteSelfParticipant(local user) orDyteRemoteParticipant(other participants in the meeting)
 - 
Moved methods for managing waiting room requests to
DyteParticipants:DyteWaitlistedParticipant.acceptWaitListedRequest()->DyteParticipants.acceptWaitingRoomRequest(id)DyteWaitlistedParticipant.rejectWaitListedRequest()->DyteParticipants.rejectWaitingRoomRequest(id)
 
The old participant hierarchy was complex, with certain types representing temporary states or behaviour at runtime. The new structure simplifies this by clearly differentiating between the local user and remote participants.
Migration Instructions:
- Replace instances of 
DyteJoinedMeetingParticipantwithDyteRemoteParticipant. - Replace any usage of 
DyteScreenShareMeetingParticipantwithDyteMeetingParticipantor its subtype. DyteSelfParticipantis now a direct subtype ofDyteMeetingParticipant.- Update the Waiting Room management logic to use APIs from 
DyteParticipantsfor accepting/rejecting waiting room requests. 
Changes in DyteMeetingRoomEventsListener Connection State Callbacks
The following connection state callbacks have been removed:
onMeetingRoomDisconnected,onConnectingToMeetingRoom,onConnectedToMeetingRoom,
onDisconnectedFromMeetingRoom,onMeetingRoomConnectionFailed,onReconnectingToMeetingRoom,
onReconnectedToMeetingRoom,onMeetingRoomReconnectionFailed
These callbacks have been consolidated into a single unified callback:
onSocketConnectionUpdate(newState: SocketConnectionState)
Migration Instructions:
- Move all connection state handling, mainly reconnection logic from the old callbacks to 
onSocketConnectionUpdate(). The new callback provides aSocketConnectionStateparameter that represents the current state of the meeting connection. 
DyteMeetingInfoV2.baseUrl has been renamed to DyteMeetingInfoV2.baseDomain. This change is applicable only if you
are using a white-labeled domain. In normal cases, now you just need to pass authToken, enableAudio & enableVideo.
Other Breaking Changes module-wise
1. DyteMobileClient (meeting)
- The following methods now return 
MeetingErrorin theonFailurecallback instead ofDyteError:init(),leaveRoom(),release()
 - Renamed some methods for adding/removing listeners to align with the respective listener names:
addParticipantEventsListener()->addParticipantsEventListener()addPollsEventsListener()->addPollsEventListener()addStageEventsListener()->addStageEventListener()addLivestreamEventListener()->addLivestreamEventListener()
 - Changes in 
DyteMeetingRoomEventsListenercallbacks:- Failure callbacks now return standardised 
MeetingErrorinstead ofException:onMeetingInitFailed(exception: KotlinException)->onMeetingInitFailed(error: MeetingError)onMeetingRoomJoinFailed(exception: KotlinException)->onMeetingRoomJoinFailed(error: MeetingError)
 - Relevant callback methods now include 
DyteMobileClientas a parameter, making it easier to access meeting objectonMeetingInitCompleted()->onMeetingInitCompleted(meeting: DyteMobileClient)onMeetingRoomJoinCompleted()->onMeetingRoomJoinCompleted(meeting: DyteMobileClient)onActiveTabUpdate(activeTab: ActiveTab)->onActiveTabUpdate(meeting: DyteMobileClient, activeTab: ActiveTab)
 
 - Failure callbacks now return standardised 
 
2. DyteSelfParticipant (meeting.localUser)
- Renamed the following screen share methods to make the name casing of "ScreenShare" uniform with the rest of the SDK:
enableScreenshare()->enableScreenShare()disableScreenshare()->disableScreenShare()
 - Merged 
onScreenShareStarted&onScreenShareStoppedinto a single callback:
onScreenShareUpdate(isEnabled: Bool) - Moved 
onRoomMessage()callback fromDyteSelfEventsListenertoDyteParticipantsEventListenerand renamed it toonNewBroadcastMessage() - Removed the unused 
onProximityChanged(isNear: Bool) 
Migration Instructions:
- Update enable/disable screen share method names
 - Replace the old screen share callbacks with the new 
onScreenShareUpdate()callback - Move the broadcast message handling logic to 
DyteParticipantsEventListener.onNewBroadcastMessage()callback 
3. DyteParticipants (meeting.participants)
- Renamed 
DyteRoomParticipantstoDyteParticipantsfor uniformity across the platforms meeting.participantsnow contains data only related to remote participants, excluding the local user- Changes in 
DyteParticipantsEventListenercallbacks:- Callbacks are now given only for remote participant events. Local user changes are dispatched to 
DyteSelfEventsListener - Listener renamed from 
DyteParticipantEventsListenertoDyteParticipantsEventListener - Merged 
onScreenShareStarted&onScreenShareEndedinto a single callback:
onScreenShareUpdate(participant: DyteRemoteParticipant, isEnabled: Bool) - Removed 
onNoActiveSpeaker(). NowonActiveSpeakerChanged(participant: DyteRemoteParticipant?)gets a null value when active participant is cleared - Removed unused, uncalled 
onScreenSharesUpdated(),onSetAsActiveSpeaker(), &onRemovedAsActiveSpeaker() - Following callbacks have been tweaked for consistency & clarity:
onAudioUpdate(audioEnabled: Bool, participant: DyteMeetingParticipant)->onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Bool)onVideoUpdate(videoEnabled: Bool, participant: DyteMeetingParticipant)->onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Bool)onPinned()->onParticipantPinned(participant: DyteRemoteParticipant)onUnpinned()->onParticipantUnpinned(participant: DyteRemoteParticipant)
 
 - Callbacks are now given only for remote participant events. Local user changes are dispatched to 
 
Migration Instructions:
- Ensure that local user-related changes are handled using 
DyteSelfEventsListenerinstead ofDyteParticipantsEventListener - Update the callback signatures wherever 
DyteParticipantsEventListeneris implemented 
4. DyteStage APIs (meeting.stage)
- Stage Host Methods:
- Removed methods 
grantAccessAll()anddenyAccessAll() grantAccess(),denyAccess(), andkick()now take a list of user IDs, making them more flexible
 - Removed methods 
 - Removed unused 
.rejectedToJoinStageconstant fromStageStatusenum - DyteStageEventListener: Callbacks now consistently use the term 'stage' to align with the DyteStage module for better clarity
- Redundant peer callbacks have been removed to simplify the API. Those events can be inferred as per use-case by
onPeerStageStatusUpdated(participant: DyteRemoteParticipant, oldStatus: StageStatus, newStatus: StageStatus) onPresentRequestReceived()->onStageAccessRequestAccepted()onStageStatusUpdated(stageStatus: DyteStageStatus)->onStageStatusUpdated(oldStatus: StageStatus, newStatus: StageStatus)onPresentRequestAdded(participant: DyteJoinedMeetingParticipant)->onNewStageAccessRequest(participant: DyteRemoteParticipant)onStageRequestsUpdated(accessRequests: [DyteJoinedMeetingParticipant])->onStageAccessRequestsUpdated(accessRequests: [DyteRemoteParticipant])- Removed 
onAddedToStage(), it was called when localUser successfully joined the stage, the name didn’t match the scenario 
 - Redundant peer callbacks have been removed to simplify the API. Those events can be inferred as per use-case by
 
Migration Instructions:
- Update the method calls for granting, denying, and kicking stage participants to use lists of user IDs
 - Replace removed/renamed callbacks in 
DyteStageEventListenerwith the new ones 
5. DytePolls APIs (meeting.polls)
- Renamed Classes and Properties
DytePollMessage->DytePollDytePollEventsListener->DytePollsEventListenerDytePolls.messages->DytePolls.items
 DytePollsEventListenerchanges:onPollUpdates(pollMessages: [DytePoll])->onPollUpdates(pollItems: [DytePoll])
6. DyteRecording APIs (meeting.recording)
- Removed following error callbacks from 
DyteRecordingEventsListenerasDyteRecordingmethods now return proper errors:onMeetingRecordingStopError(),onMeetingRecordingPauseError(),onMeetingRecordingResumeError()
 onMeetingRecordingStarted(),onMeetingRecordingEnded(), andonMeetingRecordingStateUpdated()have been merged into a single callback:
onRecordingStateChanged(oldState: DyteRecordingState, newState: DyteRecordingState).
Migration Instructions
- Remove any references to the deleted error callbacks in your code. Move error handling code to the 
onResultlambda of the recording methods. - Replace the separate recording state callbacks with the new unified 
onRecordingStateChangedcallback. 
7. DyteLivestream APIs (meeting.livestream)
- Changed the term "LiveStream" to "Livestream" throughout the SDK
meeting.liveStream->meeting.livestreamDyteLiveStream->DyteLivestream
 - Simplified 
LivestreamStateenum to align with the Web SDK- Old States: 
.none,.starting,.started,.stopping,.stopped,.errored - New States: 
.idle,.starting,.streaming,.stopping 
 - Old States: 
 DyteLivestream.liveStreamUrl->DyteLivestream.playbackUrl- Changes in 
DyteLivestreamEventsListener:- The 
DyteLiveStreamEventsListenerhas been renamed toDyteLivestreamEventListener onLiveStreamStarting,onLiveStreamStarted,onLiveStreamEnding, andonLiveStreamEndedhave been consolidated intoonLivestreamStateChanged(oldState: LivestreamState, newState: LivestreamState)onLiveStreamErrored()->onLivestreamError(message: String)onLiveStreamStateUpdate(data: DyteLivestreamData)->onLivestreamUpdate(data: DyteLivestreamData)- Removed 
onStageCountUpdated(count: Int) 
 - The 
 
Migration Instructions
- Update all class and property references to replace "LiveStream" with "Livestream"
 - Use the new 
LivestreamStateenum values, replacing old state with the new, simplified states - Update callbacks in 
DyteLivestreamEventListenerto the new versions, ensuring state changes are handled usingonLivestreamStateChangedand other revised methods