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:
DyteMeetingParticipant
was the parent class with direct subtypes:DyteJoinedMeetingParticipant
DyteWaitlistedParticipant
DyteJoinedMeetingParticipant
had two subtypes:DyteScreenShareMeetingParticipant
DyteSelfParticipant
(local user)
-
New Structure:
DyteMeetingParticipant
still 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
DyteJoinedMeetingParticipant
withDyteRemoteParticipant
. - Replace any usage of
DyteScreenShareMeetingParticipant
withDyteMeetingParticipant
or its subtype. DyteSelfParticipant
is now a direct subtype ofDyteMeetingParticipant
.- Update the Waiting Room management logic to use APIs from
DyteParticipants
for 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 aSocketConnectionState
parameter 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
MeetingError
in theonFailure
callback 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
DyteMeetingRoomEventsListener
callbacks:- Failure callbacks now return standardised
MeetingError
instead ofException
:onMeetingInitFailed(exception: KotlinException)
->onMeetingInitFailed(error: MeetingError)
onMeetingRoomJoinFailed(exception: KotlinException)
->onMeetingRoomJoinFailed(error: MeetingError)
- Relevant callback methods now include
DyteMobileClient
as 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
&onScreenShareStopped
into a single callback:
onScreenShareUpdate(isEnabled: Bool)
- Moved
onRoomMessage()
callback fromDyteSelfEventsListener
toDyteParticipantsEventListener
and 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
DyteRoomParticipants
toDyteParticipants
for uniformity across the platforms meeting.participants
now contains data only related to remote participants, excluding the local user- Changes in
DyteParticipantsEventListener
callbacks:- Callbacks are now given only for remote participant events. Local user changes are dispatched to
DyteSelfEventsListener
- Listener renamed from
DyteParticipantEventsListener
toDyteParticipantsEventListener
- Merged
onScreenShareStarted
&onScreenShareEnded
into 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
DyteSelfEventsListener
instead ofDyteParticipantsEventListener
- Update the callback signatures wherever
DyteParticipantsEventListener
is 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
.rejectedToJoinStage
constant fromStageStatus
enum - 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
DyteStageEventListener
with the new ones
5. DytePolls APIs (meeting.polls)
- Renamed Classes and Properties
DytePollMessage
->DytePoll
DytePollEventsListener
->DytePollsEventListener
DytePolls.messages
->DytePolls.items
DytePollsEventListener
changes:onPollUpdates(pollMessages: [DytePoll])
->onPollUpdates(pollItems: [DytePoll])
6. DyteRecording APIs (meeting.recording)
- Removed following error callbacks from
DyteRecordingEventsListener
asDyteRecording
methods 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
onResult
lambda of the recording methods. - Replace the separate recording state callbacks with the new unified
onRecordingStateChanged
callback.
7. DyteLivestream APIs (meeting.livestream)
- Changed the term "LiveStream" to "Livestream" throughout the SDK
meeting.liveStream
->meeting.livestream
DyteLiveStream
->DyteLivestream
- Simplified
LivestreamState
enum 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
DyteLiveStreamEventsListener
has been renamed toDyteLivestreamEventListener
onLiveStreamStarting
,onLiveStreamStarted
,onLiveStreamEnding
, andonLiveStreamEnded
have 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
LivestreamState
enum values, replacing old state with the new, simplified states - Update callbacks in
DyteLivestreamEventListener
to the new versions, ensuring state changes are handled usingonLivestreamStateChanged
and other revised methods