From 3cbfc7c77eb9d6202e6e09e546e7b91b952ff322 Mon Sep 17 00:00:00 2001 From: Swapnil Madavi Date: Fri, 15 Nov 2024 09:35:34 +0530 Subject: [PATCH 1/6] (android-core): add core V2 upgrade docs & migration guide --- docs/android-core/Introduction.mdx | 2 +- docs/android-core/pre-call/_category_.json | 2 +- docs/android-core/quickstart.mdx | 2 +- .../upgrade-v2/1-introduction.mdx | 54 +++++ .../2-breaking-changes-migration.mdx | 186 ++++++++++++++++++ docs/android-core/upgrade-v2/_category_.json | 5 + 6 files changed, 248 insertions(+), 3 deletions(-) create mode 100644 docs/android-core/upgrade-v2/1-introduction.mdx create mode 100644 docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx create mode 100644 docs/android-core/upgrade-v2/_category_.json diff --git a/docs/android-core/Introduction.mdx b/docs/android-core/Introduction.mdx index 640261ba05..535c4431f2 100644 --- a/docs/android-core/Introduction.mdx +++ b/docs/android-core/Introduction.mdx @@ -1,6 +1,6 @@ --- title: Introduction -sidebar_position: 3 +sidebar_position: 4 sidebar_class_name: module-seperation --- diff --git a/docs/android-core/pre-call/_category_.json b/docs/android-core/pre-call/_category_.json index 62c5eb9e7b..22e5bdec8e 100644 --- a/docs/android-core/pre-call/_category_.json +++ b/docs/android-core/pre-call/_category_.json @@ -1,5 +1,5 @@ { - "position": 2, + "position": 3, "label": "Pre-call", "collapsible": true, "className":"pre-call-docs" diff --git a/docs/android-core/quickstart.mdx b/docs/android-core/quickstart.mdx index b5fea12cb2..4cc59b055f 100644 --- a/docs/android-core/quickstart.mdx +++ b/docs/android-core/quickstart.mdx @@ -4,7 +4,7 @@ tags: - quickstart - setup slug: / -sidebar_position: 1 +sidebar_position: 2 --- import Tabs from '@theme/Tabs'; diff --git a/docs/android-core/upgrade-v2/1-introduction.mdx b/docs/android-core/upgrade-v2/1-introduction.mdx new file mode 100644 index 0000000000..2eca33ba24 --- /dev/null +++ b/docs/android-core/upgrade-v2/1-introduction.mdx @@ -0,0 +1,54 @@ +--- +title: Core V2 Introduction +sidebar_position: 1 +tags: + - android-core + - v2 +--- + +With the v2 release of the Dyte Core SDK, we're introducing a major upgrade focused on making the development experience simpler, more consistent, and intuitive. This upgrade introduces breaking changes across four key areas: + +### 1. Migration to V2 REST API Terminology + +- `meeting.meta.roomName` -> `meeting.meta.meetingId` +- `DyteMeetingParticipant.clientSpecificId` -> `DyteMeetingParticipant.customParticipantId` +- Removed `DyteMeetingInfo` (V1) + + +### 2. Removal of Deprecated APIs + +We have removed deprecated methods and properties in favour of improved, uniform, and clearer versions. + +- Removed `DyteParticipants.screenshares` (use `DyteParticipants.screenShares`). The deprecated type `DyteScreenShareMeetingParticipant` has also been removed +- **Chat Methods**: Removed deprecated file and image send methods. The new lambda-based methods take more reliable `Uri`s & return proper errors + - File message methods: + - Removed `sendFileMessage(filePath: String)`, `sendFileMessage(filePath: String, fileName: String)`, `sendFileMessage(fileUri: Uri)`. + Use `sendFileMessage(fileUri: Uri, onResult: (ChatFileError?) -> Unit)` + - Removed `sendFileMessage(filePath: String, peerIds: List)`, `sendFileMessage(fileUri: Uri, peerIds: List)`. + Use `sendFileMessage(fileUri: Uri, peerIds: List, onResult: (ChatFileError?) -> Unit)` + - Image message methods: + - Removed `sendImageMessage(filePath: String, fileName: String)`, `sendImageMessage(imageUri: Uri)`, `sendImageMessage(imagePath: String)`. + Use `sendImageMessage(imageUri: Uri, onResult: (ChatFileError?) -> Unit)` + - Removed `sendImageMessage(imagePath: String, peerIds: List)`, `sendImageMessage(imageUri: Uri, peerIds: List)`,  + `sendImageMessage(filePath: String, fileName: String, peerIds: List)`. + Use `sendImageMessage(imageUri: Uri, peerIds: List, onResult: (ChatFileError?) -> Unit)` +- Removed deprecated listener callbacks: + - `DyteSelfEventsListener.onStageStatusUpdated`. Use `DyteStageEventListener.onStageStatusUpdated()` + - `DyteStageEventListener.onPresentRequestAccepted(participant: DyteJoinedMeetingParticipant)` + - `DyteMeetingRoomEventsListener.onActiveTabUpdate(id: String, tabType: ActiveTabType)`. + Use `DyteMeetingRoomEventsListener.onActiveTabUpdate(meeting: DyteMobileClient, activeTab: ActiveTab)` + + +### 3. Revamped Error Handling + +- Errors are categorised by modules, such as `ChatError`, `SelfError`, and `MeetingError` +- All public APIs provide proper errors and additional error data where applicable for better debugging +- Utilises Kotlin sealed classes for better type safety + + +### 4. API Structural Changes + +We made a few direct breaking changes in our APIs to simplify the types, make methods more intuitive and ensure uniformity across platforms.  +For example, `DyteMeetingParticipant` has been restructured to align with real-world entities. + +Learn more about the direct breaking changes and migration instructions on the next page. \ No newline at end of file diff --git a/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx b/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx new file mode 100644 index 0000000000..6c29ad70fb --- /dev/null +++ b/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx @@ -0,0 +1,186 @@ +--- +title: Direct Breaking Changes and Migration Guide +sidebar_position: 2 +tags: + - android-core + - v2 +--- + +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) or + - `DyteRemoteParticipant` (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` with `DyteRemoteParticipant`. +- Replace any usage of `DyteScreenShareMeetingParticipant` with `DyteMeetingParticipant` or its subtype. +- `DyteSelfParticipant` is now a direct subtype of `DyteMeetingParticipant`. +- 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 a `SocketConnectionState` 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. + + +### Other Direct Changes module-wise + +#### 1. DyteMobileClient (meeting) + +- The following methods now return `MeetingError` in the `onFailure` callback instead of `DyteError`: + - `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 of `Exception`: + - `onMeetingInitFailed(exception: Exception)` -> `onMeetingInitFailed(error: MeetingError)` + - `onMeetingRoomJoinFailed(exception: Exception)` -> `onMeetingRoomJoinFailed(error: MeetingError)` + - Relevant callback methods now include `DyteMobileClient` as a parameter, making it easier to access meeting object + - `onMeetingInitCompleted()` -> `onMeetingInitCompleted(meeting: DyteMobileClient)` + - `onMeetingRoomJoinCompleted()` -> `onMeetingRoomJoinCompleted(meeting: DyteMobileClient)` + - `onActiveTabUpdate(activeTab: ActiveTab)` -> `onActiveTabUpdate(meeting: DyteMobileClient, activeTab: ActiveTab)` + +#### 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: Boolean)` +- Moved `onRoomMessage()` callback from `DyteSelfEventsListener` to `DyteParticipantsEventListener` and renamed it to `onNewBroadcastMessage()` +- 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.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` to `DyteParticipantsEventListener` + - Merged `onScreenShareStarted` & `onScreenShareEnded` into a single callback: + `onScreenShareUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean)` + - Removed `onNoActiveSpeaker()`. Now `onActiveSpeakerChanged(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)` + +**Migration Instructions**: + +- Ensure that local user-related changes are handled using `DyteSelfEventsListener` instead of `DyteParticipantsEventListener` +- Update the callback signatures wherever `DyteParticipantsEventListener` is implemented + +#### 4. DyteStage APIs (meeting.stage) + +- Stage Host Methods: + - Removed methods `grantAccessAll()` and `denyAccessAll()` + - `grantAccess()`, `denyAccess()`, and `kick()` now take a list of user IDs, making them more flexible +- Removed unused `REJECTED_TO_JOIN_STAGE` constant from `StageStatus` enum +- Removed the `DyteStageStatus` typealias +- 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)` -> `onStageAccessRequestsUpdated(accessRequests: List)` + - Removed `onAddedToStage()`, it was called when localUser successfully joined the stage, the name didn’t match the scenario + +**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: List)` -> `onPollUpdates(pollItems: List)` + +#### 6. DyteRecording APIs (meeting.recording) + +- Removed following error callbacks from `DyteRecordingEventsListener` as `DyteRecording` methods now return proper errors: + - `onMeetingRecordingStopError()`, `onMeetingRecordingPauseError()`, `onMeetingRecordingResumeError()` +- `onMeetingRecordingStarted()`, `onMeetingRecordingEnded()`, and `onMeetingRecordingStateUpdated()` 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` +- `DyteLivestream.liveStreamUrl` -> `DyteLivestream.playbackUrl` +- Changes in `DyteLivestreamEventsListener`: + - The `DyteLiveStreamEventsListener` has been renamed to `DyteLivestreamEventListener` + - `onLiveStreamStarting`, `onLiveStreamStarted`, `onLiveStreamEnding`, and `onLiveStreamEnded` have been consolidated into + `onLivestreamStateChanged(oldState: LivestreamState, newState: LivestreamState)` + - `onLiveStreamErrored()` -> `onLivestreamError(message: String)` + - `onLiveStreamStateUpdate(data: DyteLivestreamData)` ->  `onLivestreamUpdate(data: DyteLivestreamData)` + - Removed `onStageCountUpdated(count: Int)` + +**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 using `onLivestreamStateChanged` and other revised methods \ No newline at end of file diff --git a/docs/android-core/upgrade-v2/_category_.json b/docs/android-core/upgrade-v2/_category_.json new file mode 100644 index 0000000000..85fd7d870a --- /dev/null +++ b/docs/android-core/upgrade-v2/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 2, + "label": "2.x Upgrade Guide", + "collapsible": true +} From 13a7ef681448fa51de53680c0d95674fe07344e6 Mon Sep 17 00:00:00 2001 From: Swapnil Madavi Date: Fri, 15 Nov 2024 10:16:26 +0530 Subject: [PATCH 2/6] (ios-core): add core V2 upgrade docs & migration guide --- docs/ios-core/Introduction.mdx | 2 +- docs/ios-core/pre-call/_category_.json | 2 +- docs/ios-core/quickstart.mdx | 2 +- docs/ios-core/upgrade-v2/1-introduction.mdx | 54 +++++ .../2-breaking-changes-migration.mdx | 188 ++++++++++++++++++ docs/ios-core/upgrade-v2/_category_.json | 5 + 6 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 docs/ios-core/upgrade-v2/1-introduction.mdx create mode 100644 docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx create mode 100644 docs/ios-core/upgrade-v2/_category_.json diff --git a/docs/ios-core/Introduction.mdx b/docs/ios-core/Introduction.mdx index f9ca8a560a..c48a82e44f 100644 --- a/docs/ios-core/Introduction.mdx +++ b/docs/ios-core/Introduction.mdx @@ -1,6 +1,6 @@ --- title: Introduction -sidebar_position: 3 +sidebar_position: 4 sidebar_class_name: module-seperation --- diff --git a/docs/ios-core/pre-call/_category_.json b/docs/ios-core/pre-call/_category_.json index 5539de8b00..c37e3a93bb 100644 --- a/docs/ios-core/pre-call/_category_.json +++ b/docs/ios-core/pre-call/_category_.json @@ -1,5 +1,5 @@ { - "position": 2, + "position": 3, "label": "Pre-call", "collapsible": true, "className": "pre-call-docs" diff --git a/docs/ios-core/quickstart.mdx b/docs/ios-core/quickstart.mdx index 7a0de3504d..6c1c2e96c8 100644 --- a/docs/ios-core/quickstart.mdx +++ b/docs/ios-core/quickstart.mdx @@ -4,7 +4,7 @@ tags: - quickstart - setup slug: / -sidebar_position: 1 +sidebar_position: 2 --- import Tabs from '@theme/Tabs'; diff --git a/docs/ios-core/upgrade-v2/1-introduction.mdx b/docs/ios-core/upgrade-v2/1-introduction.mdx new file mode 100644 index 0000000000..d12f588877 --- /dev/null +++ b/docs/ios-core/upgrade-v2/1-introduction.mdx @@ -0,0 +1,54 @@ +--- +title: Core V2 Introduction +sidebar_position: 1 +tags: + - iOS-core + - v2 +--- + +With the v2 release of the Dyte Core SDK, we're introducing a major upgrade focused on making the development experience simpler, more consistent, and intuitive. This upgrade introduces breaking changes across four key areas: + +### 1. Migration to V2 REST API Terminology + +- `meeting.meta.roomName` -> `meeting.meta.meetingId` +- `DyteMeetingParticipant.clientSpecificId` -> `DyteMeetingParticipant.customParticipantId` +- Removed `DyteMeetingInfo` (V1) + + +### 2. Removal of Deprecated APIs + +We have removed deprecated methods and properties in favour of improved, uniform, and clearer versions. + +- Removed `DyteParticipants.screenshares` (use `DyteParticipants.screenShares`). The deprecated type `DyteScreenShareMeetingParticipant` has also been removed +- **Chat Methods**: Removed deprecated file and image send methods. The new closure-based methods take `NSURL`s & return proper errors + - File message methods: + - Removed `sendFileMessage(filePath: String)`, `sendFileMessage(filePath: String, fileName: String)`, `sendFileMessage(fileUri: NSURL)`. + Use `sendFileMessage(fileURL: NSURL, onResult: (ChatFileError?) -> Void)` + - Removed `sendFileMessage(filePath: String, peerIds: [String])`, `sendFileMessage(fileUri: NSURL, peerIds: [String])`. + Use `sendFileMessage(fileURL: NSURL, peerIds: [String], onResult: (ChatFileError?) -> Void)` + - Image message methods: + - Removed `sendImageMessage(filePath: String, fileName: String)`, `sendImageMessage(imageUri: NSURL)`, `sendImageMessage(imagePath: String)`. + Use `sendImageMessage(imageURL: NSURL, onResult: (ChatFileError?) -> Void)` + - Removed `sendImageMessage(imagePath: String, peerIds: [String])`, `sendImageMessage(imageUri: NSURL, peerIds: [String])`,  + `sendImageMessage(filePath: String, fileName: String, peerIds: [String])`. + Use `sendImageMessage(imageURL: NSURL, peerIds: [String], onResult: (ChatFileError?) -> Void)` +- Removed deprecated listener callbacks: + - `DyteSelfEventsListener.onStageStatusUpdated`. Use `DyteStageEventListener.onStageStatusUpdated()` + - `DyteStageEventListener.onPresentRequestAccepted(participant: DyteJoinedMeetingParticipant)` + - `DyteMeetingRoomEventsListener.onActiveTabUpdate(id: String, tabType: ActiveTabType)`. + Use `DyteMeetingRoomEventsListener.onActiveTabUpdate(meeting: DyteMobileClient, activeTab: ActiveTab)` + + +### 3. Revamped Error Handling + +- Errors are categorised by modules, such as `ChatError`, `SelfError`, and `MeetingError` +- All public APIs provide proper errors and additional error data where applicable for better debugging +- Uses enums for error codes, making it easier to handle specific cases + + +### 4. API Structural Changes + +We made a few direct breaking changes in our APIs to simplify the types, make methods more intuitive and ensure uniformity across platforms.  +For example, `DyteMeetingParticipant` has been restructured to align with real-world entities. + +Learn more about the direct breaking changes and migration instructions on the next page. \ No newline at end of file diff --git a/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx b/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx new file mode 100644 index 0000000000..9fa7a5d7df --- /dev/null +++ b/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx @@ -0,0 +1,188 @@ +--- +title: Direct Breaking Changes and Migration Guide +sidebar_position: 2 +tags: + - iOS-core + - v2 +--- + +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) or + - `DyteRemoteParticipant` (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` with `DyteRemoteParticipant`. +- Replace any usage of `DyteScreenShareMeetingParticipant` with `DyteMeetingParticipant` or its subtype. +- `DyteSelfParticipant` is now a direct subtype of `DyteMeetingParticipant`. +- 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 a `SocketConnectionState` 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 Direct Changes module-wise + +#### 1. DyteMobileClient (meeting) + +- The following methods now return `MeetingError` in the `onFailure` callback instead of `DyteError`: + - `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 of `Exception`: + - `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 object + - `onMeetingInitCompleted()` -> `onMeetingInitCompleted(meeting: DyteMobileClient)` + - `onMeetingRoomJoinCompleted()` -> `onMeetingRoomJoinCompleted(meeting: DyteMobileClient)` + - `onActiveTabUpdate(activeTab: ActiveTab)` -> `onActiveTabUpdate(meeting: DyteMobileClient, activeTab: ActiveTab)` + +#### 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 from `DyteSelfEventsListener` to `DyteParticipantsEventListener` and renamed it to `onNewBroadcastMessage()` +- 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` to `DyteParticipants` 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` to `DyteParticipantsEventListener` + - Merged `onScreenShareStarted` & `onScreenShareEnded` into a single callback: + `onScreenShareUpdate(participant: DyteRemoteParticipant, isEnabled: Bool)` + - Removed `onNoActiveSpeaker()`. Now `onActiveSpeakerChanged(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)` + +**Migration Instructions**: + +- Ensure that local user-related changes are handled using `DyteSelfEventsListener` instead of `DyteParticipantsEventListener` +- Update the callback signatures wherever `DyteParticipantsEventListener` is implemented + +#### 4. DyteStage APIs (meeting.stage) + +- Stage Host Methods: + - Removed methods `grantAccessAll()` and `denyAccessAll()` + - `grantAccess()`, `denyAccess()`, and `kick()` now take a list of user IDs, making them more flexible +- Removed unused `.rejectedToJoinStage` constant from `StageStatus` 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 + +**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` as `DyteRecording` methods now return proper errors: + - `onMeetingRecordingStopError()`, `onMeetingRecordingPauseError()`, `onMeetingRecordingResumeError()` +- `onMeetingRecordingStarted()`, `onMeetingRecordingEnded()`, and `onMeetingRecordingStateUpdated()` 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` +- `DyteLivestream.liveStreamUrl` -> `DyteLivestream.playbackUrl` +- Changes in `DyteLivestreamEventsListener`: + - The `DyteLiveStreamEventsListener` has been renamed to `DyteLivestreamEventListener` + - `onLiveStreamStarting`, `onLiveStreamStarted`, `onLiveStreamEnding`, and `onLiveStreamEnded` have been consolidated into + `onLivestreamStateChanged(oldState: LivestreamState, newState: LivestreamState)` + - `onLiveStreamErrored()` -> `onLivestreamError(message: String)` + - `onLiveStreamStateUpdate(data: DyteLivestreamData)` ->  `onLivestreamUpdate(data: DyteLivestreamData)` + - Removed `onStageCountUpdated(count: Int)` + +**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 using `onLivestreamStateChanged` and other revised methods \ No newline at end of file diff --git a/docs/ios-core/upgrade-v2/_category_.json b/docs/ios-core/upgrade-v2/_category_.json new file mode 100644 index 0000000000..85fd7d870a --- /dev/null +++ b/docs/ios-core/upgrade-v2/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 2, + "label": "2.x Upgrade Guide", + "collapsible": true +} From 7987b16f13ba6f3576c9b77e7c9ff5a343d6100f Mon Sep 17 00:00:00 2001 From: Swapnil Madavi Date: Tue, 19 Nov 2024 22:01:55 +0530 Subject: [PATCH 3/6] fix(mobile-core): Change titles of the 2.x Upgrade guide pages Core V2 Introduction -> Introduction Direct Breaking Changes.. -> Breaking Changes.. --- docs/android-core/upgrade-v2/1-introduction.mdx | 2 +- docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx | 4 ++-- docs/ios-core/upgrade-v2/1-introduction.mdx | 2 +- docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/android-core/upgrade-v2/1-introduction.mdx b/docs/android-core/upgrade-v2/1-introduction.mdx index 2eca33ba24..9d4dd942a4 100644 --- a/docs/android-core/upgrade-v2/1-introduction.mdx +++ b/docs/android-core/upgrade-v2/1-introduction.mdx @@ -1,5 +1,5 @@ --- -title: Core V2 Introduction +title: Introduction sidebar_position: 1 tags: - android-core diff --git a/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx b/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx index 6c29ad70fb..23fb7c9d46 100644 --- a/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx +++ b/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx @@ -1,5 +1,5 @@ --- -title: Direct Breaking Changes and Migration Guide +title: Breaking Changes and Migration Guide sidebar_position: 2 tags: - android-core @@ -64,7 +64,7 @@ The new callback provides a `SocketConnectionState` parameter that represents th This change is applicable only if you are using a white-labeled domain. -### Other Direct Changes module-wise +### Other Breaking Changes module-wise #### 1. DyteMobileClient (meeting) diff --git a/docs/ios-core/upgrade-v2/1-introduction.mdx b/docs/ios-core/upgrade-v2/1-introduction.mdx index d12f588877..4ad50caf9e 100644 --- a/docs/ios-core/upgrade-v2/1-introduction.mdx +++ b/docs/ios-core/upgrade-v2/1-introduction.mdx @@ -1,5 +1,5 @@ --- -title: Core V2 Introduction +title: Introduction sidebar_position: 1 tags: - iOS-core diff --git a/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx b/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx index 9fa7a5d7df..876a948200 100644 --- a/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx +++ b/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx @@ -1,5 +1,5 @@ --- -title: Direct Breaking Changes and Migration Guide +title: Breaking Changes and Migration Guide sidebar_position: 2 tags: - iOS-core @@ -65,7 +65,7 @@ This change is applicable only if you are using a white-labeled domain. In norma `enableAudio` & `enableVideo`. -### Other Direct Changes module-wise +### Other Breaking Changes module-wise #### 1. DyteMobileClient (meeting) From acc0c9219ca8b597cb8fa0026fca07e1b6f2baf9 Mon Sep 17 00:00:00 2001 From: Swapnil Madavi Date: Tue, 19 Nov 2024 22:15:49 +0530 Subject: [PATCH 4/6] fix(mobile-core): change DyteMeetingInfoV2 section to normal text --- .../upgrade-v2/2-breaking-changes-migration.mdx | 5 ++--- docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx b/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx index 23fb7c9d46..918ffe73ba 100644 --- a/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx +++ b/docs/android-core/upgrade-v2/2-breaking-changes-migration.mdx @@ -59,9 +59,8 @@ These callbacks have been consolidated into a single unified callback: The new callback provides a `SocketConnectionState` 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. +`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 diff --git a/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx b/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx index 876a948200..43f0b566ae 100644 --- a/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx +++ b/docs/ios-core/upgrade-v2/2-breaking-changes-migration.mdx @@ -59,10 +59,8 @@ These callbacks have been consolidated into a single unified callback: The new callback provides a `SocketConnectionState` 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`. +`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 From cfc15d2a69b1524d51bbc7e9ce5e269c2c9c90e1 Mon Sep 17 00:00:00 2001 From: Swapnil Madavi Date: Wed, 20 Nov 2024 10:23:09 +0530 Subject: [PATCH 5/6] chore(mobile-core): change version label to 2.x.x --- docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index f0ffd4ec39..85dcd1407b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -106,7 +106,7 @@ const docs = [ routeBasePath: '/android-core', versions: { current: { - label: '1.x.x', + label: '2.x.x', }, }, }, @@ -126,7 +126,7 @@ const docs = [ routeBasePath: '/ios-core', versions: { current: { - label: '1.x.x', + label: '2.x.x', }, }, }, From afa89b52772149401ef6ca988454b340e7c23323 Mon Sep 17 00:00:00 2001 From: Swapnil Madavi Date: Wed, 20 Nov 2024 10:49:42 +0530 Subject: [PATCH 6/6] fix(mobile-core): improve formatting of Chat APIs removal in V2 Introduction --- .../upgrade-v2/1-introduction.mdx | 32 +++++++++++++------ docs/ios-core/upgrade-v2/1-introduction.mdx | 32 +++++++++++++------ 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/docs/android-core/upgrade-v2/1-introduction.mdx b/docs/android-core/upgrade-v2/1-introduction.mdx index 9d4dd942a4..cc857bc16b 100644 --- a/docs/android-core/upgrade-v2/1-introduction.mdx +++ b/docs/android-core/upgrade-v2/1-introduction.mdx @@ -22,16 +22,30 @@ We have removed deprecated methods and properties in favour of improved, uniform - Removed `DyteParticipants.screenshares` (use `DyteParticipants.screenShares`). The deprecated type `DyteScreenShareMeetingParticipant` has also been removed - **Chat Methods**: Removed deprecated file and image send methods. The new lambda-based methods take more reliable `Uri`s & return proper errors - File message methods: - - Removed `sendFileMessage(filePath: String)`, `sendFileMessage(filePath: String, fileName: String)`, `sendFileMessage(fileUri: Uri)`. - Use `sendFileMessage(fileUri: Uri, onResult: (ChatFileError?) -> Unit)` - - Removed `sendFileMessage(filePath: String, peerIds: List)`, `sendFileMessage(fileUri: Uri, peerIds: List)`. - Use `sendFileMessage(fileUri: Uri, peerIds: List, onResult: (ChatFileError?) -> Unit)` + - Removed: + - `sendFileMessage(filePath: String)` + - `sendFileMessage(filePath: String, fileName: String)` + - `sendFileMessage(fileUri: Uri)` + - Use instead: + - `sendFileMessage(fileUri: Uri, onResult: (ChatFileError?) -> Unit)` + - Removed: + - `sendFileMessage(filePath: String, peerIds: List)` + - `sendFileMessage(fileUri: Uri, peerIds: List)` + - Use instead: + - `sendFileMessage(fileUri: Uri, peerIds: List, onResult: (ChatFileError?) -> Unit)` - Image message methods: - - Removed `sendImageMessage(filePath: String, fileName: String)`, `sendImageMessage(imageUri: Uri)`, `sendImageMessage(imagePath: String)`. - Use `sendImageMessage(imageUri: Uri, onResult: (ChatFileError?) -> Unit)` - - Removed `sendImageMessage(imagePath: String, peerIds: List)`, `sendImageMessage(imageUri: Uri, peerIds: List)`,  - `sendImageMessage(filePath: String, fileName: String, peerIds: List)`. - Use `sendImageMessage(imageUri: Uri, peerIds: List, onResult: (ChatFileError?) -> Unit)` + - Removed: + - `sendImageMessage(filePath: String, fileName: String)` + - `sendImageMessage(imageUri: Uri)` + - `sendImageMessage(imagePath: String)` + - Use instead: + - `sendImageMessage(imageUri: Uri, onResult: (ChatFileError?) -> Unit)` + - Removed: + - `sendImageMessage(imagePath: String, peerIds: List)` + - `sendImageMessage(imageUri: Uri, peerIds: List)` + - `sendImageMessage(filePath: String, fileName: String, peerIds: List)` + - Use instead: + - `sendImageMessage(imageUri: Uri, peerIds: List, onResult: (ChatFileError?) -> Unit)` - Removed deprecated listener callbacks: - `DyteSelfEventsListener.onStageStatusUpdated`. Use `DyteStageEventListener.onStageStatusUpdated()` - `DyteStageEventListener.onPresentRequestAccepted(participant: DyteJoinedMeetingParticipant)` diff --git a/docs/ios-core/upgrade-v2/1-introduction.mdx b/docs/ios-core/upgrade-v2/1-introduction.mdx index 4ad50caf9e..f75a532beb 100644 --- a/docs/ios-core/upgrade-v2/1-introduction.mdx +++ b/docs/ios-core/upgrade-v2/1-introduction.mdx @@ -22,16 +22,30 @@ We have removed deprecated methods and properties in favour of improved, uniform - Removed `DyteParticipants.screenshares` (use `DyteParticipants.screenShares`). The deprecated type `DyteScreenShareMeetingParticipant` has also been removed - **Chat Methods**: Removed deprecated file and image send methods. The new closure-based methods take `NSURL`s & return proper errors - File message methods: - - Removed `sendFileMessage(filePath: String)`, `sendFileMessage(filePath: String, fileName: String)`, `sendFileMessage(fileUri: NSURL)`. - Use `sendFileMessage(fileURL: NSURL, onResult: (ChatFileError?) -> Void)` - - Removed `sendFileMessage(filePath: String, peerIds: [String])`, `sendFileMessage(fileUri: NSURL, peerIds: [String])`. - Use `sendFileMessage(fileURL: NSURL, peerIds: [String], onResult: (ChatFileError?) -> Void)` + - Removed: + - `sendFileMessage(filePath: String)` + - `sendFileMessage(filePath: String, fileName: String)` + - `sendFileMessage(fileUri: NSURL)` + - Use instead: + - `sendFileMessage(fileURL: NSURL, onResult: (ChatFileError?) -> Void)` + - Removed: + - `sendFileMessage(filePath: String, peerIds: [String])` + - `sendFileMessage(fileUri: NSURL, peerIds: [String])` + - Use instead: + - `sendFileMessage(fileURL: NSURL, peerIds: [String], onResult: (ChatFileError?) -> Void)` - Image message methods: - - Removed `sendImageMessage(filePath: String, fileName: String)`, `sendImageMessage(imageUri: NSURL)`, `sendImageMessage(imagePath: String)`. - Use `sendImageMessage(imageURL: NSURL, onResult: (ChatFileError?) -> Void)` - - Removed `sendImageMessage(imagePath: String, peerIds: [String])`, `sendImageMessage(imageUri: NSURL, peerIds: [String])`,  - `sendImageMessage(filePath: String, fileName: String, peerIds: [String])`. - Use `sendImageMessage(imageURL: NSURL, peerIds: [String], onResult: (ChatFileError?) -> Void)` + - Removed: + - `sendImageMessage(filePath: String, fileName: String)` + - `sendImageMessage(imageUri: NSURL)` + - `sendImageMessage(imagePath: String)` + - Use instead: + - `sendImageMessage(imageURL: NSURL, onResult: (ChatFileError?) -> Void)` + - Removed: + - `sendImageMessage(imagePath: String, peerIds: [String])` + - `sendImageMessage(imageUri: NSURL, peerIds: [String])` + - `sendImageMessage(filePath: String, fileName: String, peerIds: [String])` + - Use instead: + - `sendImageMessage(imageURL: NSURL, peerIds: [String], onResult: (ChatFileError?) -> Void)` - Removed deprecated listener callbacks: - `DyteSelfEventsListener.onStageStatusUpdated`. Use `DyteStageEventListener.onStageStatusUpdated()` - `DyteStageEventListener.onPresentRequestAccepted(participant: DyteJoinedMeetingParticipant)`