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.
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: Exception)->onMeetingInitFailed(error: MeetingError)onMeetingRoomJoinFailed(exception: Exception)->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: Boolean) - Moved
onRoomMessage()callback fromDyteSelfEventsListenertoDyteParticipantsEventListenerand renamed it toonNewBroadcastMessage() - Removed the unused
onProximityChanged(isNear: Boolean)
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)
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: Boolean) - 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: Boolean, participant: DyteMeetingParticipant)->onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean)onVideoUpdate(videoEnabled: Boolean, participant: DyteMeetingParticipant)->onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean)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
REJECTED_TO_JOIN_STAGEconstant fromStageStatusenum - Removed the
DyteStageStatustypealias - 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: List<DyteJoinedMeetingParticipant>)->onStageAccessRequestsUpdated(accessRequests: List<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: List<DytePoll>)->onPollUpdates(pollItems: List<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