diff --git a/docs/ios-core/Introduction.mdx b/docs/ios-core/Introduction.mdx new file mode 100644 index 0000000000..f9ca8a560a --- /dev/null +++ b/docs/ios-core/Introduction.mdx @@ -0,0 +1,42 @@ +--- +title: Introduction +sidebar_position: 3 +sidebar_class_name: module-seperation +--- + +import ProductSection from '/docs/partials/_product-section.mdx'; + +# Introduction + +The Dyte Core SDK is designed to provide you with an easy way to incorporate live video, voice, livestream and chat capabilities +into your iOS apps. The Core SDK acts as a data-only layer. It provides simple APIs offering high-level primitives and +abstracting away complex media and networking optimizations. + +## Why Core SDK? + +The Core SDK was developed with a user-friendly approach to eliminate the complexity of managing streams. Unlike traditional +SDKs that require knowledge of WebRTC internals, Dyte's Core SDK provides a simple API that abstracts out the complexity, +making it easier for developers to use. For instance, enabling video with Dyte's Core SDK is as easy as calling +`meeting.localUser.enableVideo()`. + +## Utility Modules + +The Core SDK includes various modules for in-call utilities like chat, polls, and recording that enable building a UI on top of +it. The following are the core SDK modules: + +- **meeting.localUser**: This consists of properties and methods corresponding to the current (local) user, such as enabling or + disabling their audio and video, getting a list of media devices or changing the device, or sharing your mobile screen. +- **meeting.participants**: Use this module to get useful information about the other participants that are present in the + meeting. A host can use this module for access control. For example, the host can mute or kick a participant. +- **meeting.chat**: It provides the methods to integrate chat features such as sending/receiving text, images, and files. +- **meeting.polls**: Meetings can have polls. This module lets you perform actions related to polls, that is create and manage + a poll within a meeting. +- **meeting.recording**: When a meeting needs to be recorded, this module can be used. It lets you start or stop a recording, + and get the current status of an ongoing recording. +- **meeting.meta**: This object consists of all the metadata related to the current meeting, such as the title, the timestamp + of when it started, and more. +- **meeting.plugins**: Provides the list of available plugins and active plugins. Use this module to enable or disable plugins as needed. + + + iOS Core Introduction + diff --git a/docs/ios-core/chat/_category_.json b/docs/ios-core/chat/_category_.json index e96d76d691..175c0faaec 100644 --- a/docs/ios-core/chat/_category_.json +++ b/docs/ios-core/chat/_category_.json @@ -2,4 +2,4 @@ "position": 6, "label": "Chat", "collapsible": true -} +} \ No newline at end of file diff --git a/docs/ios-core/chat/introduction.mdx b/docs/ios-core/chat/introduction.mdx index e6f1e676d2..e099c40e24 100644 --- a/docs/ios-core/chat/introduction.mdx +++ b/docs/ios-core/chat/introduction.mdx @@ -1,19 +1,17 @@ --- title: Introducing chat description: >- - Get started with Dyte's chat capabilities in iOS Core. Follow our guide for an - introduction to chat features in iOS Core. + Learn the basics of integrating Dyte's chat functionality into your iOS + application – a step towards immersive real-time communication. sidebar_position: 1 tags: - - mobile-core + - ios-core - chat --- # Introducing chat -The meeting chat object is stored in `meeting.chat`, which has methods for -sending and receiving messages. There are 3 types of messages that can be sent -in chat - text messages, images, and files. +The meeting chat object is stored in `meeting.chat`, which has methods for sending and receiving messages. There are 3 types of messages that can be sent in chat - text messages, images, and files. The `meeting.chat.messages` array contains all the messages that have been sent in the chat. This is an array of objects, where each object is of type @@ -22,16 +20,48 @@ in the chat. This is an array of objects, where each object is of type We support three types of chat messages, they are as follows - Text Message + +```swift +class DyteTextMessage { + let userId: String + let displayName: String + let read: Bool + let pluginId: String? + let message: String + let time: String + let channelId: String? = null +} +``` + - Image Message + +```swift +class DyteImageMessage{ + let userId: String + let displayName: String + let read: Bool + let pluginId: String? + let link: String + let time: String + let channelId: String? = null +} +``` + - File Message +```swift +class DyteFileMessage{ + let userId: String + let displayName: String + let read: Bool + let pluginId: String? + let name: String + let time: String + let link: String + let size: Int64 + let channelId: String? = null +} +``` + All above objects are of type `DyteChatMessage` along with their own class variables. - - - iOS Core Introducing chat - - diff --git a/docs/ios-core/chat/receiving-chat-messages.mdx b/docs/ios-core/chat/receiving-chat-messages.mdx index 2b1aa1fc97..15f32866d3 100644 --- a/docs/ios-core/chat/receiving-chat-messages.mdx +++ b/docs/ios-core/chat/receiving-chat-messages.mdx @@ -1,11 +1,11 @@ --- title: Receiving chat messages description: >- - Learn how to receive chat messages in iOS Core with Dyte Docs. Enhance your - app's communication capabilities with seamless chat integration. + "Discover how to implement the functionality to receive chat messages in your + iOS app using Dyte sidebar_position: 3 tags: - - mobile-core + - ios-core - chat --- @@ -14,56 +14,20 @@ tags: To be able to receive chat messages you need to implement a method `onChatUpdates()` method from callback `DyteChatEventsListener`. You can subscribe to this events by calling -`meeting.addMeetingEventsListener(dyteChatEventsListener)` +`meeting.addChatEventsListener(dyteChatEventsListener)` ```swift - extension MeetingViewModel: DyteChatEventsListener { - func onChatUpdates(messages: [DyteChatMessage]) { - // any update in chat messages - } - - func onNewChatMessage(message: DyteChatMessage) { - // updates for new chat messages only - } - } +extension MeetingViewModel: DyteChatEventsListener { + func onChatUpdates(messages: [DyteChatMessage]) { + // to load chat messages + } + + func onNewChatMessage(message: DyteChatMessage) { + // when a new chat message is shared in the meeting + } +} ``` -Here, the `message` is of type `Message`, as defined in -[introduction](./introduction). `messages` is a list of all chat messages in the -meeting, which is the same as `meeting.chat.messages`. - -When a chat message is received, the `meeting.chat.messages` list is also -updated. - -DyteChatMessage has different implementations of it, thus you will need to cast and use appropriate type as follows: - -```swift - func onNewChatMessage(message: DyteChatMessage) { - if let msg = message { - switch msg.type { - case .text: - if let textMsg = msg as? DyteTextMessage { - //print("onNewChatMessage: Text : \(textMsg)") - } - case .file: - if let fileMsg = msg as? DyteFileMessage { - //print("onNewChatMessage: File : \(fileMsg.name)") - } - case .image: - if let imgMsg = msg as? DyteImageMessage { - //print("onNewChatMessage: Image : \(imgMsg.link)") - } - - default: - print("Error! Message type unknown!") - } - } -``` +The `onChatUpdates()` method will be called whenever there is a change in the chat messages. The `messages` parameter is a list of `DyteChatMessage` objects that have been sent in the chat. - - iOS Core Receiving chat messages - - +The `onNewChatMessage()` method will be called whenever a new chat message is shared in the meeting. The `message` parameter is a `DyteChatMessage` object that has been sent in the chat. diff --git a/docs/ios-core/chat/sending-a-chat-message.mdx b/docs/ios-core/chat/sending-a-chat-message.mdx index 3e9dd26953..7853d4ac88 100644 --- a/docs/ios-core/chat/sending-a-chat-message.mdx +++ b/docs/ios-core/chat/sending-a-chat-message.mdx @@ -1,28 +1,25 @@ --- title: Sending a chat message description: >- - Explore the process of sending a chat message in iOS Core with Dyte Docs. - Empower users to communicate effectively within your app. + "Master the process of sending chat messages within your iOS application + with Dyte sidebar_position: 2 tags: - - mobile-core + - ios-core - chat --- # Sending a chat message -As mentioned in [introduction](./introduction), there are 3 types of chat -messages - text messages, images, and files. There is a method in `meeting.chat` -to send a message of each type. +As mentioned in [introduction](./introduction), there are 3 types of chat messages - text messages, images, and files. There is a method in `meeting.chat` to send a message of each type. ## Send a text message -To send a text message, the `meeting.chat.sendTextMessage()` method can be used. -This accepts a string `message` and sends it to the room. +To send a text message, the `meeting.chat.sendTextMessage()` method can be used. This accepts a string `message` and sends it to the room. ```swift -let message = "Is this the real life?" -meeting.chat.sendTextMessage(message: message) +var message = "Is this the real life?" +meeting.chat.sendTextMessage(message) ``` ## Send an image @@ -31,28 +28,17 @@ You can send an image with the help of `meeting.chat.sendImageMessage()` and sends it to the participants in the meeting. ```swift -let filePath = "file_path_of_image" -let fileName = "file_name" -meeting.chat.sendImageMessage(filePath: filePath, fileName: fileName) +var filePath = "file_path_of_image" +var fileName = "file_name" +meeting.chat.sendImageMessage(filePath, fileName) ``` ## Send a file -Sending a file is quite similar to sending an image. The only difference is that -when you send an image, a preview will be shown in the meeting chat, which is -not the case for sending files. That being said, an image can be sent as a file -too using `meeting.chat.sendFileMessage()`. +Sending a file is quite similar to sending an image. The only difference is that when you send an image, a preview will be shown in the meeting chat, which is not the case for sending files. That being said, an image can be sent as a file too using `meeting.chat.sendFileMessage()`. ```swift -let filePath = "file_path_of_image" -let fileName = "file_name" -meeting.chat.sendFileMessage(filePath: filePath, fileName: fileName) +var filePath = "file_path_of_image" +var fileName = "file_name" +meeting.chat.sendFileMessage(filePath, fileName) ``` - - - iOS Core Sending a chat message - - diff --git a/docs/ios-core/error-codes.mdx b/docs/ios-core/error-codes.mdx new file mode 100644 index 0000000000..6fedc0ab47 --- /dev/null +++ b/docs/ios-core/error-codes.mdx @@ -0,0 +1,39 @@ +--- +title: System Error Codes +sidebar_position: 11 +--- + +:::info Note + +This information is intended for developers debugging or troubleshooting Dyte's mobile core system errors. + +::: + +Error codes are a standardized method for developers to convey application errors and issues to users or other developers in a structured manner. Error codes typically consist of a numerical or alphanumeric code and a description that provides more information about the error. + +This document lists Dyte's iOS core error codes that you may encounter in various scenarios. System error codes can arise in different parts of the system, and their descriptions may not always provide exact details. To address these codes effectively, you must first understand the programmatic and runtime contexts in which these errors occurred. + +## Error codes and format + +Error codes consist of a number that are categorized by the type of error and a message that provides more information about the error. The error code format is as follows: + +```swift +class DyteError { + let code: Int + let message: String +} +``` + +### Meeting error codes + +Meeting error codes are used to indicate errors that occur during meeting operations. These errors are typically returned by the methods of the `meeting` object such as `init()`, `join()`. + +- 1000: Invalid auth token. +- 1002: Failed to initialize meeting. +- 1003: Invalid base URL. +- 1005: Failed to join room. +- 4000: Something went wrong. + + + iOS Core System Error Codes + diff --git a/docs/ios-core/livestream/dyte-livestream-object.mdx b/docs/ios-core/livestream/dyte-livestream-object.mdx deleted file mode 100644 index d49234f47c..0000000000 --- a/docs/ios-core/livestream/dyte-livestream-object.mdx +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: Livestream objects & methods -description: >- - Dive into the details of the Dyte Livestream Object in iOS Core with Dyte - Docs. Understand key elements for effective integration and streaming - management. -sidebar_position: 2 -tags: - - mobile-core - - livestream ---- - -`DyteLivestream` object obtained by `dyteMobileClient.livestream` method. The objects and methods it contains are defined below. - -## Objects - -### roomName [*String*] - -The name of the room.
- -### state [*LiveStreamState*] - -The current status of the livestream, possible values can be:
- -- `LiveStreamState.NONE` -- `LiveStreamState.STARTING` -- `LiveStreamState.STARTED` -- `LiveStreamState.STOPPING` -- `LiveStreamState.STOPPED` -- `LiveStreamState.ERRORED` - -### stage requests [*_List<DyteLiveStreamStageRequestPeer>_*] - -object accessed via `dyteMobileClient.livestream.stageRequestPeers` contains the list of requests to join the stage. Each request contains 3 properties:
- -1. `peerId`: [*String*] The peerId of the user who requested to join the stage. -2. `userId`: [*String*] The userId of the user who requested to join the stage. -3. `displayName`: [*String*] The display name of the user who requested to join the stage.

- -### liveStreamUrl [*String*] - -List of URL which can be used to consume livestream. - -## **Host Controls Methods** - -Dyte's stage management APIs allow hosts to receive and manage stage requests as well as leave and join the stage. - -### Accept request - -This method lets the host accept a request to join the stage. It takes the _DyteLiveStreamStageRequestPeer.id_ as an argument whose request has to be accepted. - -```swift -dyteMobileClient.livestream.acceptRequest(peer: peer.id); -``` - -### Reject request - -This method lets the host reject a request to join the stage. It takes the _DyteLiveStreamStageRequestPeer.id_ as an argument whose request has to be rejected. - -```swift -dyteMobileClient.livestream.rejectRequest(peer: peer.id); -``` - -### Accept all requests - -This method lets the host accept all the requests to join the stage. - -```swift -dyteMobileClient.livestream.acceptAll(); -``` - -### Reject all requests - -This method lets the host reject all the requests to join the stage. - -```swift -dyteMobileClient.livestream.rejectAll(); -``` - - - iOS Core Livestream objects & methods - - diff --git a/docs/ios-core/livestream/introduction.mdx b/docs/ios-core/livestream/introduction.mdx deleted file mode 100644 index 0cafd842b5..0000000000 --- a/docs/ios-core/livestream/introduction.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Introduction -description: >- - Get introduced to the livestream feature in iOS Core with Dyte Docs. Explore - the features and benefits of integrating livestreaming into your app. -sidebar_position: 1 -tags: - - mobile-core - - livestream ---- - -# Introduction - Livestream - -This section will guide you through the process of integrating the livestreaming feature into your product. Using Dyte's live-streaming state management APIs you can easily manage stage requests, such as leave and join stage, manage permissions, kick participants and so on. - -The foundation of Dyte's livestreaming is based on a stage, which can be accessed by hosts and viewers. While hosts can directly enter the stage, viewers can request to join it. The stage is broadcasted live to all viewers. - - - iOS Core Introduction - - diff --git a/docs/ios-core/livestream/dyte-livestream-listener.mdx b/docs/ios-core/livestreaming.mdx similarity index 52% rename from docs/ios-core/livestream/dyte-livestream-listener.mdx rename to docs/ios-core/livestreaming.mdx index 143b53ffc4..ac72254fc5 100644 --- a/docs/ios-core/livestream/dyte-livestream-listener.mdx +++ b/docs/ios-core/livestreaming.mdx @@ -1,15 +1,87 @@ --- -title: Livestream event listeners -description: >- - Integrate the Dyte Livestream Listener in iOS Core with our comprehensive - guide. Enhance your app's real-time streaming capabilities seamlessly. -sidebar_position: 3 -tags: - - mobile-core - - livestream +title: Livestreaming +sidebar_position: 10 --- -You can listen to livestream events by attaching a listener by calling `addLivestreamEventsListener` on `dyteMobileClient` object where `dyteMobileClient` is an instance of `DyteMobileClient()`. +- Livestreaming is often used for events, such as concerts, conferences, and sports games, as well as for online classes, gaming, and social media platforms. +- Dyte uses LHLS to deliver low latency one way streams +- The Interactive Livestream product delivers interactivity via chat, polls, reactions etc +- Viewer can also be pulled in the livestream by the host using Stage Management APIs + +This topic talks about how you can use livestreaming properties, events, and functions. + +`DyteLivestream` object obtained by `meeting.livestream` method. The objects and methods it contains are defined below. + +## Objects + +### roomName [*String*] + +The name of the room.
+ +### state [*LiveStreamState*] + +The current status of the livestream, possible values can be:
+ +- `LiveStreamState.NONE` +- `LiveStreamState.STARTING` +- `LiveStreamState.STARTED` +- `LiveStreamState.STOPPING` +- `LiveStreamState.STOPPED` +- `LiveStreamState.ERRORED` + +### stage requests [*_List<DyteLiveStreamStageRequestPeer>_*] + +object accessed via `meeting.livestream.stageRequestPeers` contains the list of requests to join the stage. Each request contains 3 properties:
+ +1. `peerId`: [*String*] The peerId of the user who requested to join the stage. +2. `userId`: [*String*] The userId of the user who requested to join the stage. +3. `displayName`: [*String*] The display name of the user who requested to join the stage.

+ +### liveStreamUrl [*String*] + +List of URL which can be used to consume livestream. + +## **Host Controls Methods** + +Dyte's stage management APIs allow hosts to receive and manage stage requests as well as leave and join the stage. + +### Accept request + +This method lets the host accept a request to join the stage. It takes the _DyteLiveStreamStageRequestPeer.id_ as an argument whose request has to be accepted. + +```swift +meeting.livestream.acceptRequest(peer: peer.id); +``` + +### Reject request + +This method lets the host reject a request to join the stage. It takes the _DyteLiveStreamStageRequestPeer.id_ as an argument whose request has to be rejected. + +```swift +meeting.livestream.rejectRequest(peer: peer.id); +``` + +### Accept all requests + +This method lets the host accept all the requests to join the stage. + +```swift +meeting.livestream.acceptAll(); +``` + +### Reject all requests + +This method lets the host reject all the requests to join the stage. + +```swift +meeting.livestream.rejectAll(); +``` + +You can listen to livestream events by attaching a listener by calling `addLivestreamEventsListener` on `meeting` object where `meeting` is an instance of `DyteMobileClient()`. + +```swift +meeting.addLiveStreamEventsListener(liveStreamEventsListener: self) +``` ```swift extension LivestreamViewController: DyteLiveStreamEventsListener { @@ -58,8 +130,6 @@ extension LivestreamViewController: DyteLiveStreamEventsListener { } } - -meeting.addLiveStreamEventsListener(liveStreamEventsListener: self) ``` ## Livestream events @@ -116,10 +186,6 @@ meeting.addLiveStreamEventsListener(liveStreamEventsListener: self) public func onJoinRequestRejected(peer: LiveStreamStagePeer) {} ``` - - iOS Core Livestream event listeners - - + + iOS Core Livestreaming + diff --git a/docs/ios-core/local-user/_category_.json b/docs/ios-core/local-user/_category_.json index f02d560bef..38f1722fd3 100644 --- a/docs/ios-core/local-user/_category_.json +++ b/docs/ios-core/local-user/_category_.json @@ -1,5 +1,5 @@ { - "position": 3, + "position": 5, "label": "Local User", "collapsible": true -} +} \ No newline at end of file diff --git a/docs/ios-core/local-user/events.mdx b/docs/ios-core/local-user/events.mdx index c8921fb657..fd9a074c27 100644 --- a/docs/ios-core/local-user/events.mdx +++ b/docs/ios-core/local-user/events.mdx @@ -5,7 +5,7 @@ description: >- leverage these events for enhanced user experiences within your app. sidebar_position: 2 tags: - - mobile-core + - ios-core - local-user - self --- @@ -16,25 +16,12 @@ You can subscribe to various events on the local user by implementing `DyteSelfEventsListener` and passing the object to `meeting.addSelfEventsListener(dyteSelfEventsListener)`. -### Room joined - -Triggered when the room join event completes and now the meeting is ready to -produce and consume media. - -```swift -extension MeetingViewModel: DyteSelfEventsListener { - func onRoomJoined() { - //Room Joined - } -} -``` - ### Video update Triggered when the user starts / stops the video using `enableVideo` or `disableVideo` -```kotlin +```swift extension MeetingViewModel: DyteSelfEventsListener { func onVideoUpdate(videoEnabled: Bool) { if (videoEnabled) { @@ -68,7 +55,7 @@ extension MeetingViewModel: DyteSelfEventsListener { Triggered when the user is disconnected due to media/network errors -```kotlin +```swift extension MeetingViewModel: DyteSelfEventsListener { func onMeetingRoomDisconnected() { //disconnected @@ -138,6 +125,23 @@ extension MeetingViewModel: DyteSelfEventsListener { } ``` +## Listen to Broadcast message within the room + +Get broadcast messages within the room using `onRoomMessage` callback. + +_Parameters_: + +`type`: A client-specific type to differentiate between custom messages like "emoji" or "greetings" + +`payload`: A dictionary containing the message payload, where keys are strings and values are of any type. + +```swift +extension MeetingViewModel: DyteSelfEventsListener { + func onRoomMessage(type: String, payload: [String : Any]) { + // triggered when a message is sent within the room. + } +``` + iOS Core Events - Learn about local user management in iOS Core with Dyte Docs. Understand the fundamentals for effective integration and app customization. -sidebar_position: 1 +sidebar_position: 3 tags: - - mobile-core + - ios-core - local-user - self --- @@ -79,7 +79,7 @@ meeting.localUser.setDisplayName("New Name") ## Mute/Unmute microphone -```kotlin +```swift // Mute Audio meeting.localUser.disableAudio() @@ -92,7 +92,7 @@ meeting.localUser.audioEnabled ## Enable/Disable camera -```kotlin +```swift // Disable Video meeting.localUser.disableVideo() @@ -103,9 +103,22 @@ meeting.localUser.enableVideo() meeting.localUser.videoEnabled ``` +## Pinning & unpinning + +You can pin or unpin yourself given you have the appropriate permissions. You +can check the pinned status of the local user using `meeting.localUser.isPinned`. + +```swift +meeting.localUser.pin(); +``` + +```swift +meeting.localUser.unpin(); +``` + ## Enable / Disable Screen share -```kotlin +```swift // Enable Screenshare meeting.localUser.enableScreenshare(); diff --git a/docs/ios-core/local-user/manage-media-devices.mdx b/docs/ios-core/local-user/manage-media-devices.mdx index 0b335741ed..338fb80813 100644 --- a/docs/ios-core/local-user/manage-media-devices.mdx +++ b/docs/ios-core/local-user/manage-media-devices.mdx @@ -5,7 +5,7 @@ description: >- Docs. Optimize your app's media handling capabilities seamlessly. sidebar_position: 3 tags: - - web-core + - ios-core - local-user - localUser - localUser events diff --git a/docs/ios-core/local-user/manage-permissions.mdx b/docs/ios-core/local-user/manage-permissions.mdx index a653910f56..74085e6a3e 100644 --- a/docs/ios-core/local-user/manage-permissions.mdx +++ b/docs/ios-core/local-user/manage-permissions.mdx @@ -5,7 +5,7 @@ description: >- Ensure a smooth and secure user experience within your app. sidebar_position: 4 tags: - - mobile-core + - ios-core - local-user - self - self events diff --git a/docs/ios-core/local-user/screen-share-guide.mdx b/docs/ios-core/local-user/screen-share-guide.mdx index 559ce9b073..1a48d55e06 100644 --- a/docs/ios-core/local-user/screen-share-guide.mdx +++ b/docs/ios-core/local-user/screen-share-guide.mdx @@ -40,8 +40,6 @@ Add your extension to an app group by going to your extension's target in the pr - Edit your SampleHandler class to look something like this. ```swift - - import ReplayKit import DyteiOSCore @@ -75,7 +73,6 @@ class SampleHandler: RPBroadcastSampleHandler { } } - ``` ### Modify Info.plist diff --git a/docs/ios-core/participants/_category_.json b/docs/ios-core/participants/_category_.json index 5ec4ab7972..2599bb6c6c 100644 --- a/docs/ios-core/participants/_category_.json +++ b/docs/ios-core/participants/_category_.json @@ -1,5 +1,5 @@ { - "position": 4, - "label": "Participants", + "position": 5, + "label": "Remote Participants", "collapsible": true -} +} \ No newline at end of file diff --git a/docs/ios-core/participants/events.mdx b/docs/ios-core/participants/events.mdx index d29b6a38c8..6ba4bdc887 100644 --- a/docs/ios-core/participants/events.mdx +++ b/docs/ios-core/participants/events.mdx @@ -1,18 +1,21 @@ --- title: Participant Events description: >- - Explore participant events in iOS Core with Dyte Docs. Leverage these events - for dynamic interactions and enhanced collaboration within your app. + Dive into the details of handling participant events in your iOS + application using Dyte's comprehensive documentation. sidebar_position: 3 tags: - - mobile-core + - ios-core - participants - self --- +# All Participant Events + You can subscribe to events for all participants by implementing -`DyteParticipantEventsListener` callback and then passing that object to +`DyteParticipantEventsListener` protocol and then passing that object to `meeting.addParticipantEventsListener(dyteParticipantEventsListener)` method. + Here are the supported methods: ## Participant joined @@ -39,22 +42,14 @@ Triggers an event when any participant leaves the meeting. } ``` -## Screenshare updates +## Participant update -Triggers an event when there is any change in screenshares in a meeting. +Triggers an event whenever there is any change in participant. ```swift extension MeetingViewModel: DyteParticipantEventsListener { - func onScreenSharesUpdated() { - // your code here to handle screenshares from meeting - // you can use `meeting.participants.screenshares` to get latest screenshare participants - } - func onScreenShareEnded(participant: DyteMeetingParticipant) { - // your code here to handle screenshare ended - } - - func onScreenShareStarted(participant: DyteMeetingParticipant) { - // your code here to handle screenshare started + func onUpdate(participants: DyteParticipants) { + // your code here to handle participant update } } ``` @@ -83,9 +78,30 @@ Trigger an event when any participant starts / stops audio. } ``` +## Screenshare updates + +Triggers an event when there is any change in screenshares in a meeting. + +```swift + extension MeetingViewModel: DyteParticipantEventsListener { + func onScreenSharesUpdated() { + // your code here to handle screenshares from meeting + // you can use `meeting.participants.screenshares` to get latest screenshare participants + } + + func onScreenShareStarted(participant: DyteJoinedMeetingParticipant) { + // participant stared presenting screen in the meeting + } + + func onScreenShareEnded(participant: DyteJoinedMeetingParticipant) { + // participant stopped presenting screen in the meeting + } + } +``` + ## Active speaker -Trigger an event when any is change in active speaker in the meeting. +Triggers an event when any is change in active speaker in the meeting. ```swift extension MeetingViewModel: DyteParticipantEventsListener { @@ -101,7 +117,7 @@ Trigger an event when any is change in active speaker in the meeting. ## Pinned participant -Trigger an event when any is change in pinned participant in the meeting. +Triggers an event when there is any change in pinned participant in the meeting. ```swift extension MeetingViewModel: DyteParticipantEventsListener { @@ -109,7 +125,7 @@ Trigger an event when any is change in pinned participant in the meeting. // your code here to show pinned participant } - func onParticipantUnpinned(participant: DyteMeetingParticipant) { + func onParticipantUnpinned(participant: DyteJoinedMeetingParticipant) { // your code here to remove pinned participant } } @@ -117,7 +133,7 @@ Trigger an event when any is change in pinned participant in the meeting. ## Active participants list change -Triggers an event when any change in active participants list in the meeting. +Triggers an event when any is change in active participants list in the meeting. ```swift extension MeetingViewModel: DyteParticipantEventsListener { @@ -127,10 +143,84 @@ Triggers an event when any change in active participants list in the meeting. } ``` +# Single Participant Events + +You can also subscribe to events for a single participant by implementing `DyteParticipantUpdateListener` protocol and then passing that object to `participant.addParticipantUpdateListener(dyteParticipantUpdateListener)` method. + +Here are the supported methods: + +### Participant update + +Triggers an event whenever there is any change in participant. + +```swift + extension MeetingViewModel: DyteParticipantUpdateListener { + func onUpdate() { + // your code here to handle participant update + } + } +``` + +### Video update + +Triggers an event when the participant starts / stops video. + +```swift + extension MeetingViewModel: DyteParticipantUpdateListener { + func onVideoUpdate(isEnabled: Bool) { + // your code here to handle participant video toggle update + } + } +``` + +### Audio update + +Triggers an event when the participant starts / stops audio. + +```swift + extension MeetingViewModel: DyteParticipantUpdateListener { + func onAudioUpdate(isEnabled: Bool) { + // your code here to handle participant audio toggle update + } + } +``` + +### Pinned & Unpinned participant + +Triggers an event when the participant is pinned / unpinned. + +```swift + extension MeetingViewModel: DyteParticipantUpdateListener { + func onPinned() { + // your code here to show pinned participant + } + + func onUnpinned() { + // your code here to remove pinned participant + } + } +``` + +### Screen share started & ended + +Triggers an event when the participant starts / stops screen sharing. + +```swift + extension MeetingViewModel: DyteParticipantUpdateListener { + func onScreenShareStarted() { + // your code here to handle screen share started + } + + func onScreenShareEnded() { + // your code here to handle screen share ended + } + } +``` + - iOS Core Participant Events + iOS Core The participant events diff --git a/docs/ios-core/participants/introduction.mdx b/docs/ios-core/participants/introduction.mdx deleted file mode 100644 index f6ae408935..0000000000 --- a/docs/ios-core/participants/introduction.mdx +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: Introduction -description: >- - Explore the introduction to participants in iOS Core with Dyte Docs. Learn how - to enhance your app's collaborative features seamlessly. -sidebar_position: 1 -tags: - - mobile-core - - participants - - participant ---- - -# Introduction - Room participants - -The data regarding all meeting participants is stored under -`meeting.participants`. Use the methods and events to consume the participants -data. - -## Room participants object. - -- `joined`: A list that contains all the participants who have joined the - meeting. -- `waitlisted`: A list that contains all the participants waiting to join the - meeting. -- `active`: A list that contains all the participants except the local user who - are supposed to be on the screen at the moment -- `pinned`: A nullable participant object. If any participant is pinned is that - participant else it is null. -- `screenshares`: A list that contains all the participants who have shared - screen in the meeting. -- `gridInfo`: This object has all data related to pages in the room. - -Each participant in each of the `joined`, `waitlisted`, `active` and -`screenshares` list is of type `DyteMeetingParticipant`. - -For example, to get all the participants who joined the meeting: - -```swift -// get all joined participants -let joinedParticipants = meeting.participants.joined; -``` - -For example, to get all the active participants in the meeting: - -```swift -// get all active participants -let joinedParticipants = meeting.participants.active; -``` - -Therefore, if you were to make a grid of participants, you'd use the `active` -list, but to display all participants in the meeting you'd use the `joined` -list. - -## Grid info for the room - -Following object can be retrieved from `meeting` object by using -`meeting.participants.gridInfo`. This object will have necessary information -regarding pageCount, next page, previos page, current page, etc. - -```swift - let pageCount: Int - let currentPageNumber: Int - let isNextPagePossible: Bool - let isPreviousPagePossible: Bool - let shouldShowPaginator: Bool - let maxVideoCountPerPage: Int -``` - -## Video update for all participants - -Triggered when the user starts / stops the video using `enableVideo` or -`disableVideo` - -```swift -extension MeetingViewModel: DyteParticipantEventsListener { - func videoUpdate(videoEnabled: Boolean, participant: DyteMeetingParticipant) { - if (videoEnabled) { - // video is enabled, and other participants in room can see local user - } else { - // video is disabled, and other participants in room can not see local user. - } - } -} -``` - -## Audio update for all participants - -Triggered when the user starts / stops the audio using `enableAudio` or -`disableAudio` - -```swift -extension MeetingViewModel: DyteParticipantEventsListener { - func audioUpdate(audioEnabled: Boolean, participant: DyteMeetingParticipant) { - if (audioEnabled) { - // audio is enabled, and other participants in room can hear local user - } else { - // audio is disabled, and other participants in room can not hear local user. - } - } -} -``` - -## Move between pages in paginated mode - -The `setPage(pageNumber: Int)` method allows you to switch between pages of -participants present in the meeting. - -```swift -// switch to 1st page -meeting.participants.setPage(1) -``` - -## Host control methods - -The `meeting.participants` object has host control methods that allow you to -disable the audio and video streams of other users in the meeting (given that -the user preset has the right permissions). - -```swift -// mute all participants -meeting.participants.disableAllAudio() - -// mute a single participant -let participantToUpdate = meeting.participants.joined.first -participantToUpdate.disableAudio() - -// disable video for all participants -meeting.participants.disableAllVideo() - -// disable video for a single participant -let participantToUpdate = meeting.participants.joined.first() -participantToUpdate.disableVideo() -``` - -To remove all participants from a meeting, you can call the `kickAll()` method. - -```swift -// remove all participants from the meeting -meeting.participants.kickAll() - -// remove a single participant -let participantToRemove = meeting.participants.joined.first() -participantToRemove.kick() -``` - - - iOS Core Introduction - - diff --git a/docs/ios-core/participants/participant-object.mdx b/docs/ios-core/participants/participant-object.mdx index 089e40c094..91f34d37f9 100644 --- a/docs/ios-core/participants/participant-object.mdx +++ b/docs/ios-core/participants/participant-object.mdx @@ -1,23 +1,16 @@ --- -title: The participant object -description: >- - Dive into the details of iOS Core Participant Objects with Dyte Docs. - Understand the key elements for effective integration and participant - management. +title: Participant Object +description: The object corresponding to a particular participant. sidebar_position: 2 +slug: /participants/participant-object tags: - - mobile-core + - ios-core - participants - - participant --- # The participant object -The `participant` object consists of all the information related to a particular -participant. For instance, it contains a participants video/audio/screenshare -stream, and the participant's name. It also contains state variables that -indicate whether a participant's camera is on or off, and whether they are muted -or unmuted. +The `participant` object consists of all the information related to a particular participant. For instance, it contains a participants video/audio/screenshare stream, and the participant's name. It also contains state variables that indicate whether a participant's camera is on or off, and whether they are muted or unmuted. The participant object has the following properties. @@ -32,86 +25,111 @@ The participant object has the following properties. screen share stream. - `videoEnabled`: Set to true if the participant's camera is on. - `audioEnabled`: Set to true if the participant is unmuted. -- `isPinned`: True if current user is pinned in the meeting room +- `isPinned`: True if current user is pinned in the meeting room. - `presetName`: Name of the preset associated with the participant. +- `stageStatus`: Status of stage for the participant -## To get Video view of a given participant +## To get video view of a given participant You can call `participant.getVideoView()` which will return a View which further -can used to add in any View. +can used to add in any view. Similarly one can use `participant.getScreenShareView()` which will return a -View which further can used to add in any View. +View which further can used to add in any view. -## Audio/Video updates for participant +## Host Controls -You can listen to audio/video changes for a single participant by calling -`addParticipantUpdateListener(listener: DyteParticipantUpdateListener)` on any -participant object. +If you are the host of the room, you can use the **host controls**. The host controls allow you to manage the participants in the room. + +The host controls include the following options: + +- **Mute/Unmute**: Mute or unmute a participant. +- **Kick**: Kick a participant from the room. +- **Pin**: Pin a participant's video. +- **Turn off video**: Turn off a participant's video. + +You can also use these methods from our participant object to +perform these actions programmatically. ```swift -dyteParticipant.addParticipantUpdateListener(participantUpdateListener: self) +if let participant = meeting.participants.joined.first(where: { $0.id == participantId }) { + // To disable a participant's video stream + participant.disableVideo() -extension MeetingViewModel: DyteParticipantUpdateListener { - func onAudioUpdate(participant: DyteMeetingParticipant, isEnabled: Bool) { - // on audio update - } + // To disable a participant's audio stream + participant.disableAudio() - func onVideoUpdate(participant: DyteMeetingParticipant, isEnabled: Bool) { - // on video update - } + // To kick a participant from the meeting + participant.kick() +} +``` - func onPinned(participant: DyteMeetingParticipant) { - // when participant is pinned - } +## Waiting Room - func onUnpinned(participant: DyteMeetingParticipant) { - // when participant is un-pinned - } +Host can use these waiting room methods from our participant object to +perform these actions programmatically. - func onScreenShareStarted(participant: DyteMeetingParticipant) { - // when participant start to screenshare - } +```swift +// Accept the request and let the participant in the meeting +participant.acceptWaitListedRequest() - func onScreenShareEnded(participant: DyteMeetingParticipant) { - // when participant stops screenshare - } -} +// Reject the request, do not permit the participant to join the meeting +participant.rejectWaitListedRequest() ``` -Also make sure to remove event listener when they are no longer used. You can -remove DyteParticipantUpdateListener by calling -`removeParticipantUpdateListener(listener)` +## pin/unpin -## Host controls methods +You can also `pin` or `unpin` a participant in the meeting. All "pinned" +participants are added to the `meeting.participants.pinned`. -If you (the local user) have the relevant permissions in the meeting, you can -disable a participant's video/audio streams, or even remove them from the -meeting. +```swift +if let participant = meeting.participants.joined.first(where: { $0.id == participantId }) { + // To pin a participant + participant.pin() + + // To unpin a participant + participant.unpin() +} +``` + +## Move between pages in paginated mode + +The `setPage(pageNumber: Int)` method allows you to switch between pages of +participants present in the meeting. ```swift -let participant = meeting.participants.joined.first +// switch to 1st page +meeting.participants.setPage(1) +``` + +## Broadcast message to all participants -// To disable a participant's video stream -participant.disableVideo() +Send a broadcast message to all `joined` participants -// To disable a participant's audio stream -participant.disableAudio() +_Parameters_: -// To kick a participant from the meeting -participant.kick() +`type`: A client-specific type to differentiate between custom messages like "emoji" or "greetings" -// to pin a participant in a meeting -participant.pin() +`payload`: A dictionary containing the message payload, where keys are strings and values are of any type. -// to retrieve if current participant is already pinned in a meeting -participant.isPinned +```swift +// broadcast message +meeting.participants.broadcastMessage(type, payload) ``` +# Receiving Broadcast messages + +To be able to receive broadcast messages you need to implement a method +`onRoomMessage` method from callback `DyteSelfEventsListener`. You can +subscribe to this events by calling +`meeting.addChatEventsListener(dyteSelfEventsListener)` + +[check this dyteSelfEventsListener broadcastMessage documentation](/ios-core/local-user/events#listen-to-broadcast-message-within-the-room) + iOS Core The participant object diff --git a/docs/ios-core/participants/remote-participants.mdx b/docs/ios-core/participants/remote-participants.mdx new file mode 100644 index 0000000000..dc5136fb56 --- /dev/null +++ b/docs/ios-core/participants/remote-participants.mdx @@ -0,0 +1,41 @@ +--- +title: Participant Types +description: 'Events, methods and data pertaining to meeting participants.' +sidebar_position: 1 +slug: /participants/ +tags: + - ios-core + - participants +--- + +# Participant Types + +The data regarding all meeting participants is stored under `meeting.participants`. These **does not** include the local user. Use the methods and events to consume the participants data. For example, to get all the participants who joined the meeting: + +```swift +// get all joined participants +var joined: [DyteJoinedMeetingParticipant] = meeting.participants.joined + +// get all participants +var all: [DyteParticipant] = meeting.participants.all +``` + +The `meeting.participants` object has the following **lists** of participants + +- **all**: A list that contains all the participants who have joined the meeting except the local user +- **joined**: A list that contains all the participants who are currently in the meeting + except the local user +- **waitlisted**: A list that contains all the participants waiting to join the + meeting. +- **active**: A list that contains all the participants except the local user whose media is subscribed to i.e + participants are supposed to be on the screen at the moment except the local user +- **pinned**: A list that contains all the pinned participants of the meeting. +- **screenShares**: A list that contains all the participants who are sharing their screen. + +Therefore if you were to make a video / audio grid of participants, you'd use the `active` map, but to display the list of all participants in the meeting you'd use the `joined` map. + +Each participant in each of the `joined`, `active`, `pinned` and `screenShares` list are of type `DyteJoinedMeetingParticipant`, `waitlisted` list is of type `DyteWaitlistedParticipant` and `all` list is of type `DyteParticipant`. + + + iOS Core Participants + diff --git a/docs/ios-core/participants/waitlisted-participants.mdx b/docs/ios-core/participants/waitlisted-participants.mdx new file mode 100644 index 0000000000..2e1c8978c1 --- /dev/null +++ b/docs/ios-core/participants/waitlisted-participants.mdx @@ -0,0 +1,64 @@ +--- +title: Waitlisted Participants +description: 'Events, methods and data to manage waiting room participants.' +sidebar_position: 4 +tags: + - ios-core + - participants + - waitlisted + - waiting room +--- + +Participants in the waiting room are represented by `DyteWaitlistedParticipant` objects. If the local user has the permission to +accept waiting room requests (`selfPermissions.host.canAcceptRequests` is true), you can manage pending waiting room requests, +accepting or rejecting them as needed. +You can access the list of waitlisted participants via the `meeting.participants.waitlisted` property. + +**Note**: If the local user is not a host, `meeting.participants.waitlisted` property returns an empty list. + +### Accepting Requests + +To accept a waiting room request, use the acceptWaitListedRequest() method on a `DyteWaitlistedParticipant` object: + +```swift +let waitlistedParticipant = meeting.participants.waitlisted[0] +waitlistedParticipant.acceptWaitListedRequest() +``` + +### Rejecting Requests + +To deny a waiting room request, use the `rejectWaitListedRequest()` method on a `DyteWaitlistedParticipant` object: + +```swift +let waitlistedParticipant = meeting.participants.waitlisted[0] +waitlistedParticipant.rejectWaitListedRequest() +``` + +### Waiting Room Events + +Implement the `DyteWaitlistEventsListener` interface to listen for events related to the waiting room: + +```swift +extension MeetingViewModel: DyteWaitlistEventsListener { + + func onWaitListParticipantJoined(participant: DyteMeetingParticipant) { + // triggered when waitList peer is joined + } + + func onWaitListParticipantAccepted(participant: DyteMeetingParticipant) { + // triggered when waitListed peer is accepted by host + } + + func onWaitListParticipantRejected(participant: DyteMeetingParticipant) { + // triggered when entry of waitListed peer declined by host + } + + func onWaitListParticipantClosed(participant: DyteMeetingParticipant) { + // triggered when waitListed peer get's disconnected + } +} +``` + + + iOS Core Waitlisted Participants + diff --git a/docs/ios-core/plugins.mdx b/docs/ios-core/plugins.mdx deleted file mode 100644 index 205039908c..0000000000 --- a/docs/ios-core/plugins.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Plugins -description: >- - Discover the power of iOS Core Plugins with Dyte Docs. Elevate your app's - functionality by integrating plugins seamlessly into your collaboration - features. -sidebar_position: 8 -tags: - - mobile-core - - plugins ---- - -# Plugins - -The meetings plugins can be accessed using `meeting.plugins`. It provides two -main objects, `all` which contains list of all Plugin objects in a -`DyteMeeting`. And `active` list which contains plugins which are enabled and -are currently being used in this meeting. - -## Playing with plugins - -Plugins are webviews which can be added in any view. To be able to get webview -from DytePlugin one needs to first activate a plugin. To do that all we need to -do is call `plugin.active()` which will trigger a callback in -`onPluginActivated()`. Similarly to deactivate a plugin one can call -`plugin.deactivate()` and that plugin will be deactivated in the meeting. - -```swift -plugin.activate() // to activate a plugin -plugin.deactivate() // to deactivate a plugin -``` - -## Active plugin - -To check if a `plugin` is active or not in a meeting one can use - -```swift -let isActive = plugin.isActive -``` - -## Listening to plugins in a meeting - -To be able to listen to plugin events you need to implement a methods from -callback `DytePluginEventsListener`. You can subscribe to these events by calling -`meeting.addPluginEventsListener(dytePluginEventsListener: listener)` - -```swift -extension MeetingViewModel: DytePluginEventsListener { - - func onPluginActivated(plugin: DytePlugin) { - // your code to handle plugin activation - } - - func onPluginDeactivated(plugin: DytePlugin) { - // your code to handle plugin de-activation - } - - func onPluginFileRequest(plugin: DytePlugin) { - // your code to handle plugin file request - } - - func onPluginMessage(message: [String : Kotlinx_serialization_jsonJsonElement]) { - // your code to handle plugin message - } -} -``` - - - iOS Core Plugins - - diff --git a/docs/ios-core/livestream/_category_.json b/docs/ios-core/plugins/_category_.json similarity index 60% rename from docs/ios-core/livestream/_category_.json rename to docs/ios-core/plugins/_category_.json index d03d7d50cd..072077b2d4 100644 --- a/docs/ios-core/livestream/_category_.json +++ b/docs/ios-core/plugins/_category_.json @@ -1,5 +1,5 @@ { "position": 7, - "label": "Livestream", + "label": "Plugins", "collapsible": true -} +} \ No newline at end of file diff --git a/docs/ios-core/plugins/disable-plugin.mdx b/docs/ios-core/plugins/disable-plugin.mdx new file mode 100644 index 0000000000..a56659b31d --- /dev/null +++ b/docs/ios-core/plugins/disable-plugin.mdx @@ -0,0 +1,28 @@ +--- +title: Functions to disable plugins +description: Methods on a plugin in a meeting. +sidebar_position: 3 +tags: + - ios-core + - plugins +--- + +# Functions to disable plugins + +Each plugin in `meeting.plugins` object is of type +[`DytePlugin`](./introduction) and exposes the following functions to disable +plugins. + +### Deactivate Plugin + +The `deactivate()` method deactivates the plugin for all users in the meeting. When you deactivate a plugin, it moves out of the active plugins list and can only be accessed from `meeting.plugins.all`. + +```swift +let plugin = meeting.plugins.active[0] + +plugin.deactivate() +``` + + + Mobile Core Function to disable plugins + diff --git a/docs/ios-core/plugins/enable-plugin.mdx b/docs/ios-core/plugins/enable-plugin.mdx new file mode 100644 index 0000000000..dc09e4233f --- /dev/null +++ b/docs/ios-core/plugins/enable-plugin.mdx @@ -0,0 +1,62 @@ +--- +title: Functions to enable plugins +description: Methods on a plugin in a meeting. +sidebar_position: 2 +tags: + - ios-core + - plugins +--- + +# Functions to enable plugins + +Each plugin in `meeting.plugins` object is of type +[`DytePlugin`](./introduction) and exposes the following functions to enable +plugins. + +### Get Plugin View + +This method adds the communication layer between the plugin inside the WebView and +the core SDK (meeting object) in your application. + +```swift +let plugin = meeting.plugins.active[0] + +plugin.getPluginView() // This will return a WebView +``` + +The `getPluginView()` method returns a WebView that can be added to a UIView. + +### Activate Plugins + +The `activate()` method activates a plugin for all users in the meeting. When +you activate a plugin, it moves into the active plugins map and can be accessed +from `meeting.plugins.active`. + +The snippet below retrieves the first plugin from the list and activates it. + +```swift +var plugin: DytePlugin = meeting.plugins.all[0] + +plugin.activate() +``` + +This directly activates the plugin without any user interaction. + +### Activate a plugin on click + +You can also show a list of all plugins and activate a plugin on click programmatically. + +```swift +func togglePlugin(index: Int) { + let plugin = plugins[index] + if plugin.isActive { + plugin.deactivate() + }else { + plugin.activate() + } +} +``` + + + Mobile Core Function to enable plugins + diff --git a/docs/ios-core/plugins/extra.mdx b/docs/ios-core/plugins/extra.mdx new file mode 100644 index 0000000000..b97dc638bb --- /dev/null +++ b/docs/ios-core/plugins/extra.mdx @@ -0,0 +1,49 @@ +--- +title: Other methods +description: Methods on a plugin in a meeting. +sidebar_position: 4 +tags: + - ios-core + - plugins +--- + +## Send data to the plugin + +You can send data (type `any`) to a plugin using the `sendData()` method. This method comes in handy when building your own plugin. + +```swift +let pluginId = "..." +if let plugin = meeting.plugins.active.first(where: { $0.id == pluginId }) { + plugin.sendData(eventName: "my-custom-event", data: "Hello world") +} +``` + +## Receive data from the plugin + +You can receive data from a plugin by implementing the methods defined in `DytePluginEventsListener` interface. +This method comes in handy when building your own plugin. Listen Plugin events +using `meeting.addPluginEventsListener(meetingViewModel)` + +```swift +extension MeetingViewModel: DytePluginEventsListener { + func onPluginActivated(plugin: DytePlugin) { + ... + } + + func onPluginDeactivated(plugin: DytePlugin) { + ... + } + + func onPluginMessage(plugin: DytePlugin, eventName: String, data: Any?) { + ... + } + + func onPluginFileRequest(plugin: DytePlugin) { + ... + } +} +``` + + + iOS Core extra plugins Function + diff --git a/docs/ios-core/plugins/introduction.mdx b/docs/ios-core/plugins/introduction.mdx new file mode 100644 index 0000000000..f027581493 --- /dev/null +++ b/docs/ios-core/plugins/introduction.mdx @@ -0,0 +1,53 @@ +--- +title: Introduction +description: Manage plugins in a meeting. +sidebar_position: 1 +tags: + - ios-core + - plugins +--- + +# Introduction + +Plugins are one-click add-ons that can make your meetings more immersive and collaborative. Dyte provides a bunch of inbuilt plugins to choose from, you can also build your own plugins using the [Plugin SDK](../../plugin-sdk/). + +The meeting plugins can be accessed from the `meeting.plugins` object, it exposes the following. + +| Property | Type | Description | +| -------- | ---- | -------------------------------------- | +| active | List | All plugins that are currently in use. | +| all | List | All plugins the meeting has access to. | + +Each plugin in the list is of type `DytePlugin` which has the following public fields and methods: + +```swift +class DytePlugin { + let id: String + let name: String + let description: String + let picture: String + let isPrivate: Bool + let staggered: Bool + let baseURL: String + let config: PluginConfig + let isActive: Bool + let enabledBy: String? + + func activate() + func deactivate() + func getPluginView(): WebView + func sendData(eventName: String, data: Any?) +} +``` + +The `PluginConfig` type consists of the following fields: + +```swift +class PluginConfig { + let accessControl: String = "FULL_ACCESS" +} +``` + + + Mobile Core Introduction + diff --git a/docs/ios-core/polls/_category_.json b/docs/ios-core/polls/_category_.json index 3d3e19b415..fe2eed0b04 100644 --- a/docs/ios-core/polls/_category_.json +++ b/docs/ios-core/polls/_category_.json @@ -1,5 +1,5 @@ { - "position": 7, + "position": 10, "label": "Polls", "collapsible": true } diff --git a/docs/ios-core/polls/creating-a-poll.mdx b/docs/ios-core/polls/creating-a-poll.mdx index f9d4970892..f09921d8d7 100644 --- a/docs/ios-core/polls/creating-a-poll.mdx +++ b/docs/ios-core/polls/creating-a-poll.mdx @@ -1,11 +1,11 @@ --- title: Creating a poll description: >- - Learn the step-by-step process of creating a poll in iOS Core with Dyte Docs. - Enhance your app's engagement and decision-making capabilities. + Create and manage polls in your iOS app using Dyte's documentation on + Polls Creation. sidebar_position: 2 tags: - - mobile-core + - ios-core - polls - create --- @@ -35,9 +35,9 @@ meeting.polls.create( ``` - iOS Core Creating a poll + Mobile Core Creating a poll diff --git a/docs/ios-core/polls/introduction.mdx b/docs/ios-core/polls/introduction.mdx index 3dc11c37d5..84667d670a 100644 --- a/docs/ios-core/polls/introduction.mdx +++ b/docs/ios-core/polls/introduction.mdx @@ -1,11 +1,11 @@ --- title: Introduction description: >- - Get introduced to the polls feature in iOS Core with Dyte Docs. Explore how - polls can enrich your app's interactive capabilities for users. + Learn the fundamentals of integrating polls into your iOS application with + Dyte's Polls Introduction guide. sidebar_position: 1 tags: - - mobile-core + - ios-core - polls --- @@ -17,36 +17,53 @@ methods to create polls, vote, and more. `meeting.polls.polls` returns an array of all polls created in a meeting, where each element is an object of type `DytePollMessage`. +```swift +class DytePollMessage{ + let id: String + let question: String + let anonymous: Bool + let hideVotes: Bool + let createdBy: String + let options: [DytePollOption] +} +``` + The type `DytePollMessage` is the main class for any poll in Dyte. It also contains list of `DytePollOption` which are options for a given poll. And every `DytePollOption` has list of votes inside of it. Votes are objects of class `DytePollVote` which internally has id and name of the vote. +```swift +class DytePollOption{ + let text: String + let votes: [DytePollVote] + let count: Int +} + +class DytePollVote{ + let id: String + let name: String +} +``` + One can easily create, vote and view polls by listening to callbacks on `meeting` object. ## Listening to new polls in a meeting -To receive new poll messages, you must implement the `onPollUpdates()` method from -the callback DytePollEventsListener. You can subscribe to this event by -using the `meeting.addMeetingEventsListener(dytePollEventsListener)` method. +To be able to receive new poll messages you need to implement a method +`onPollUpdates()` method from callback `DyteMeetingRoomEventsListener`. You can +subscribe to this events by calling +`meeting.addMeetingEventsListener(meetingViewModel)` ```swift - extension MeetingViewModel: DytePollEventsListener { - func onNewPoll(poll: DytePollMessage) { - // code to handle new poll - } - - func onPollUpdates(pollMessages: [DytePollMessage]) { - // code to handle polls and their vote updates - } - } -``` +extension MeetingViewModel: DyteMeetingRoomEventsListener { + func onNewPoll(poll: DytePollMessage) { + // code to handle new poll + } - - iOS Core Introduction - - + func onPollUpdates(pollMessages: [DytePollMessage]) { + // code to handle polls and their vote updates. + } +} +``` diff --git a/docs/ios-core/polls/voting-on-a-poll.mdx b/docs/ios-core/polls/voting-on-a-poll.mdx index b8298dd0a5..a424c5c05a 100644 --- a/docs/ios-core/polls/voting-on-a-poll.mdx +++ b/docs/ios-core/polls/voting-on-a-poll.mdx @@ -1,11 +1,11 @@ --- title: Voting on a poll description: >- - Understand the voting process on polls within iOS Core with Dyte Docs. Empower - users to actively participate and express their opinions. + Understand the process of voting on polls within your iOS app using Dyte's + documentation on Polls Voting. sidebar_position: 3 tags: - - mobile-core + - ios-core - polls - votes --- @@ -15,24 +15,17 @@ tags: The `meeting.polls.vote()` method can be used to register a vote on a poll. It accepts the following params. -| Param | Type | Default Value | Required | Description | -| ----- | ------ | ------------- | -------- | ------------------------------------------ | -| id | string | - | yes | The ID of the poll that is to be voted on. | -| index | number | - | yes | The index of the option. | +| Param | Type | Default Value | Required | Description | +| ----------- | --------------- | ------------- | -------- | ---------------------------- | +| pollMessage | DytePollMessage | - | yes | The poll message to vote on. | +| pollOption | DytePollOption | - | yes | The option to vote for. | The following snippet votes for the 1st option on the 1st poll created in the meeting. ```swift -let poll = meeting.polls.items.first -let selectedPollOption = poll.options.first -meeting.polls.vote(pollMessage: poll, pollOption: selectedPollOption) -``` +let poll: DytePollMessage = meeting.polls.items[0] +let selectedPollOption: DytePollOption = poll.options[0] - - iOS Core Voting on a poll - - +meeting.poll.vote(poll, selectedPollOption) +``` diff --git a/docs/ios-core/pre-call/1-media-preview.mdx b/docs/ios-core/pre-call/1-media-preview.mdx new file mode 100644 index 0000000000..88d2b6fb9f --- /dev/null +++ b/docs/ios-core/pre-call/1-media-preview.mdx @@ -0,0 +1,119 @@ +# Media Preview + +Before joining a meeting, users may want to preview and configure their media devices like camera, microphone, and audio output. +This section provides developers with the tools to prepare the media environment before joining a Dyte meeting. + +If you are using our UI Kits, this functionality can be handled by `DyteSetupViewController` or built with `DyteParticipantTileView` +and `DyteSettingViewController` components. + +## Properties + +- `meeting.localUser.audioEnabled`: A boolean value indicating if the audio currently enabled. +- `meeting.localUser.videoEnabled`: A boolean value indicating if the video currently enabled. + +## Methods + +### Toggling Media + +The same methods used for controlling media during a meeting are also applicable for pre-call media configuration. + +**1. Mute/Unmute microphone** + +```swift +// Mute Audio +meeting.localUser.disableAudio() + +// Unmute Audio +meeting.localUser.enableAudio() +``` + +```mermaid +flowchart LR + classDef basic fill:white; + + eam("enableAudio()") --> success("Gives onAudioUpdate callback to DyteSelfEventsListener") + + class eam basic; +``` + +
+ +Anytime there is an update in the audio state of the local user, the Core SDK notifies the client through the `onAudioUpdate` callback +from `DyteSelfEventsListener`. Here's how you can register the listener: + +```swift +extension MeetingViewModel: DyteSelfEventsListener { + func onAudioUpdate(audioEnabled: Boolean) { + // Show a visual preview of the audio to the user if enabled + } +} +``` + +**2. Enable/Disable camera** + +```swift +// Disable Video +meeting.localUser.disableVideo() + +// Enable Video +meeting.localUser.enableVideo() +``` + +```mermaid +flowchart LR + classDef basic fill:white; + + eam("enableVideo()") --> success("Gives onVideoUpdate callback to DyteSelfEventsListener") + + class eam basic; +``` + +
+ +Whenever there is an update in the video state of the local user, the Core SDK notifies the client through the `onVideoUpdate` callback +from `DyteSelfEventsListener`. Here's how you can register the listener: + +```swift +extension MeetingViewModel: DyteSelfEventsListener { + func onVideoUpdate(videoEnabled: Boolean) { + // Show local user's VideoView if video is enabled + } +} +``` + +### Changing Media Device + +Media devices represent the hardware for the camera, microphone, and speaker devices. To get the list of media devices currently +available, use the following methods: + +```swift +// Get all audio devices +let audioDevices = meeting.localUser.getAudioDevices() + +// Get all video devices +let videoDevices = meeting.localUser.getVideoDevices() +``` + +To get the currently selected media device, use the following methods: + +```swift +// Get current audio device being used +let currentAudioDevice = meeting.localUser.getSelectedAudioDevice() + +// Get current video device being used +let currentVideoDevice = meeting.localUser.getSelectedVideoDevice() +``` + +Use these methods to create a UI that allows users to configure their media devices. When the user selects a device, use the below methods to set the device. + +**Set device** + +```swift +// Set audio device +meeting.localUser.setAudioDevice(device) +// eg. device = audioDevices[0] + +// Set video device +meeting.localUser.setVideoDevice(device) +// eg. device = videoDevices[0] +``` diff --git a/docs/ios-core/pre-call/2-handling-permissions.mdx b/docs/ios-core/pre-call/2-handling-permissions.mdx new file mode 100644 index 0000000000..c734ab6349 --- /dev/null +++ b/docs/ios-core/pre-call/2-handling-permissions.mdx @@ -0,0 +1,43 @@ +# Handling Device Permissions + +Before allowing users to interact with their camera and microphone, it's important to check if the necessary permissions are +granted on their iOS device. Dyte's iOS Core SDK provides easy-to-use APIs to check the status of these permissions. + +### Checking Permissions + +Use the following APIs to check if the camera and microphone permissions are granted: + +```swift +// Check if CAMERA permission is granted +let cameraPermissionGranted = meeting.localUser.isCameraPermissionGranted + +// Check if RECORD_AUDIO (microphone) permission is granted +let micPermissionGranted = meeting.localUser.isMicrophonePermissionGranted +``` + +Alternatively, you can also use standard way to check if these permissions are granted: + +```swift +if AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo) == AVAuthorizationStatus.Authorized { + // Already Authorized +} else { + AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo, completionHandler: { (granted: Bool) -> Void in + if granted == true { + // User granted + } else { + // User rejected + } + }) +} +``` + +Refer to the [iOS official documentation](https://developer.apple.com/documentation/avfoundation/capture_setup/requesting_authorization_to_capture_and_save_media) +for more information on checking permissions. + +You can use the permission status to enable or disable camera and microphone buttons in the pre-call UI, or provide visual +feedback to indicate the availability of these media devices. + +### Automatic Permission Request + +When the Dyte SDK is initialised, it automatically checks for the required media permissions. If the permissions are not granted, +the SDK requests them on behalf of the developers. diff --git a/docs/ios-core/pre-call/3-meeting-meta.mdx b/docs/ios-core/pre-call/3-meeting-meta.mdx new file mode 100644 index 0000000000..dd3aa76308 --- /dev/null +++ b/docs/ios-core/pre-call/3-meeting-meta.mdx @@ -0,0 +1,11 @@ +# Meeting Metadata + +### Change the name of the user + +You can allow the user to edit their name by using the `setDisplayName` method. + +```swift +meeting.localUser.setDisplayName("New Name") +``` + +**Note**: The name change will only be reflected to other participants if this method is called before joining the room. diff --git a/docs/ios-core/pre-call/4-waiting-room.mdx b/docs/ios-core/pre-call/4-waiting-room.mdx new file mode 100644 index 0000000000..9466edd7a3 --- /dev/null +++ b/docs/ios-core/pre-call/4-waiting-room.mdx @@ -0,0 +1,56 @@ +# Waiting Room + +When you call `meeting.joinRoom()`, the user either enters the meeting room directly if allowed, or they are placed in the waiting room +if they are a waitlisted participant. + +The diagram illustrates the possible room states the local user can be in. + +```mermaid +stateDiagram-v2 + init --> joined + init --> waitlisted + waitlisted --> joined + waitlisted --> rejected +``` + +
+ +### Meeting Room Joined + +If user joins the room successfully, you receive the `onMeetingRoomJoinCompleted` callback in `DyteMeetingRoomEventsListener`. +You can listen for this callback as follows: + +```swift +extension MeetingViewModel: DyteMeetingRoomEventsListener { + func onMeetingRoomJoinCompleted() { + // Local user is in the meeting + } +} +``` + +### Waitlisted Participant + +If the user is waitlisted, the `onWaitListStatusUpdate` callback in `DyteSelfEventsListener` notifies you of any changes in the +user's waitlist status. You can check the `waitListStatus` to determine their status: + +- `WAITING`: Local user is in the waiting room. +- `REJECTED`: Local user's join room request is rejected by the host. + +```swift +extension MeetingViewModel: DyteSelfEventsListener { + func onWaitListStatusUpdate(waitListStatus: WaitListStatus) { + switch waitListStatus { + case .accepted: + // Local user's join room request was accepted by the host + case .waiting: + // Local user is in the waiting room + case .rejected: + // Local user's join room request was rejected by the host + default: + return .none + } + } +} +``` + +Host can use [these methods to accept/reject participants](/ios-core/participants/participant-object#waiting-room). diff --git a/docs/ios-core/pre-call/_category_.json b/docs/ios-core/pre-call/_category_.json new file mode 100644 index 0000000000..5539de8b00 --- /dev/null +++ b/docs/ios-core/pre-call/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 2, + "label": "Pre-call", + "collapsible": true, + "className": "pre-call-docs" +} \ No newline at end of file diff --git a/docs/ios-core/quickstart.mdx b/docs/ios-core/quickstart.mdx index cab88cf594..7a0de3504d 100644 --- a/docs/ios-core/quickstart.mdx +++ b/docs/ios-core/quickstart.mdx @@ -1,28 +1,24 @@ --- -title: Quickstart -description: >- - Dive into Dyte's core documentation for iOS. Follow our guide for - comprehensive understanding and effective iOS core development. -sidebar_position: 1 tags: - - mobile-core + - ios-core - quickstart + - setup slug: / +sidebar_position: 1 --- -import { CocoaPodInstallation } from '@site/src/components/LatestInstallation'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +import { MavenLatestInstallation } from '@site/src/components/LatestInstallation'; +import { CocoaPodInstallation } from '@site/src/components/LatestInstallation'; -# iOS Core SDK Quickstart +# Quickstart -This quickstart shows how to use Dyte's iOS Core SDK to add live video and audio -to your iOS applications. +This quickstart shows how to use Dyte's core SDKs to add live video and audio to +your iOS applications. -For getting started quickly, you can use our -[sample code](https://github.com/dyte-io/ios-samples/tree/main/iOS-core). You can clone -and run a sample application from the -[iOS Core SDK GitHub repository](https://github.com/dyte-io/ios-samples/tree/main/iOS-core). +To get started quickly, you can use our sample code. You can clone and run a sample application from the iOS Core samples, +available in both [Swift](https://github.com/dyte-io/ios-samples/tree/main/iOS-core) and [SwiftUI](https://github.com/dyte-io/ios-samples/tree/main/DyteSwiftUI-Core). ## Objective @@ -30,32 +26,22 @@ You'll learn how to: - [Install the Dyte SDK](#step-1-install-the-sdk) - [Initialize the SDK](#step-2-initialize-the-sdk) -- [Configure a Dyte meeting](#step-3-set-the-properties-in-the-dytemeetinginfo-class) -- [Initialize the Dyte meeting](#step-4-initialize-the-connection-request) -- [Go live with your Dyte meeting!](#step-5-connect-to-the-meeting) +- [Configure a Dyte meeting](#step-3-configure-a-dyte-meeting) +- [Initialize the Dyte meeting](#step-4-initialize-the-dyte-meeting) +- [Go live with your Dyte meeting](#step-5-go-live-with-your-dyte-meeting) ## Before Getting Started -- Make sure you've read the - [Getting Started with Dyte](/getting-started) topic and - completed the steps in the - [Integrate Dyte](/getting-started#integrate-dyte) section. - You must complete the following steps: - - Create a [Dyte Developer Account](https://dev.dyte.io/) - - Create a - [Dyte Meeting](/api/?v=v2#/operations/create_meeting) - - [Add Participant](/api/?v=v2#/operations/add_participant) - to the meeting -- Install - [Xcode](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwin55bqodH8AhUVQXwKHaR-DAsQFnoECA0QAQ&url=https%3A%2F%2Fapps.apple.com%2Fus%2Fapp%2Fxcode%2Fid497799835%3Fmt%3D12&usg=AOvVaw2fEvMbfRtGhB4SPHYB54NX) -- Ensure that Rosetta is installed with Xcode on Mac computers with Apple - silicon. -- Make sure your Mac computers are running macOS version 12.0 Monterey or - higher. +Make sure you've read the [Getting Started with Dyte](/getting-started) topic and completed the following steps: + +- Create a [Dyte Developer Account](https://dev.dyte.io/) +- Create a [Dyte Meeting](/api/?v=v2#/operations/create_meeting) +- [Add Participant](/api/?v=v2#/operations/add_participant) to the meeting +- Install [Xcode](https://apps.apple.com/in/app/xcode/id497799835) ## Step 1: Install the SDK - + 1. Set your platform to iOS 13.0 or above in your Podfile. @@ -82,9 +68,7 @@ Add `DyteiOSCore` SDK through Swift Package Manager in Xcode. Use https://github -4. Add the following entries to the info.plist file. This gives permission to - your app to access the camera and microphone, access photos, install the - required fonts and icons. +Add the following entries to the info.plist file. This gives permission to your app to access the camera and microphone, access photos, install the required fonts and icons. ```xml NSBluetoothPeripheralUsageDescription @@ -128,7 +112,6 @@ let meeting = DyteiOSClientBuilder().build() meeting.addMeetingRoomEventsListener(meetingRoomEventsListener: self) meeting.addParticipantEventsListener(participantEventsListener: self) meeting.addSelfEventsListener(selfEventsListener: self) -meeting.addParticipantEventsListener(participantEventsListener: self) meeting.addChatEventsListener(chatEventsListener: self) meeting.addPollEventsListener(pollEventsListener: self) meeting.addRecordingEventsListener(recordingEventsListener: self) @@ -136,16 +119,16 @@ meeting.addWaitlistEventListener(waitlistEventListener: self) meeting.addLiveStreamEventsListener(liveStreamEventsListener: self) ``` -## Step 3: Set the properties in the DyteMeetingInfo class +## Step 3: Configure a Dyte meeting Add `authToken` that you got from the REST API to constructor of DyteMeetingInfoV2 - [Add Participant API](/api#/operations/addParticipant) -| Name | Description | -| ------------- | ---------------------------------------------------------------- | -| `authToken` | After you've created the meeting, add each participant to the meeting using the [Add Participant API](/api?v=v2#/operations/add_participant) The API response contains the `authToken`. | -| `enableAudio` | Set whether to join the meeting with your Mic ON or OFF by passing `true` or `false`.| -| `enableVideo` | Set whether to join the meeting with your Camera ON or OFF by passing `true` or `false`.| -| `baseUrl` | Base URL of the dyte's enviorment you have created the meeting on. | +| Name | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `authToken` | After you've created the meeting, add each participant to the meeting using the [Add Participant API](/api?v=v2#/operations/add_participant) The API response contains the `authToken`. | +| `enableAudio` | Set whether to join the meeting with your Mic ON or OFF by passing `true` or `false`. | +| `enableVideo` | Set whether to join the meeting with your Camera ON or OFF by passing `true` or `false`. | +| `baseUrl` | Base URL of the dyte's enviorment you have created the meeting on. | ```swift let meetingInfo = DyteMeetingInfoV2(authToken: authToken, @@ -154,7 +137,7 @@ let meetingInfo = DyteMeetingInfoV2(authToken: authToken, baseUrl: "dyte.io") ``` -## Step 4: Initialize the connection request +## Step 4: Initialize the Dyte meeting To initialize the connection request, call the `doInit()` method obtained on `meeting` with the `meetingInfo` argument. This will establish the connection @@ -169,10 +152,12 @@ Note: This is the asynchronous method, You will have to attached observer (meeti ```swift func onMeetingInitCompleted() { - } + // init complete +} func onMeetingInitFailed(exception: KotlinException) { - } + // init failed +} ``` OR @@ -186,7 +171,9 @@ meeting.doInit(dyteMeetingInfo: DyteMeetingInfoV2, To initialize the connection request, call the `doInit` method which is asynchronous and callback based. -## Step 5: Connect to the meeting +## Step 5: Go live with your Dyte meeting + +### Connect to the meeting Now, you have established the connection with the Dyte meeting server successfully. Once `onMeetingInitCompleted()` is triggered, next step is to join diff --git a/docs/ios-core/recording.mdx b/docs/ios-core/recording.mdx index 419458c31a..1f297ad728 100644 --- a/docs/ios-core/recording.mdx +++ b/docs/ios-core/recording.mdx @@ -1,92 +1,95 @@ --- title: Recording -description: >- - Delve into the recording capabilities of iOS Core with Dyte Docs. Learn how to - seamlessly integrate and enhance your app's recording functionalities. -sidebar_position: 9 +description: Control recordings in a meeting. +sidebar_position: 8 tags: - - mobile-core + - ios-core - recording --- # Recording -The `meeting.recording` object can be used start and stop recordings in a -meeting. You can also get the current status of a recording using this API. +The `meeting.recording` object in Dyte's iOS Core SDK provides APIs to manage recording within a meeting. -The `meeting.recording` object has the following properties: +### Recording State -- `recordingState`: Indicates the current recording state of the meeting. +The `meeting.recording.recordingState` property indicates the current state of the recording. Possible states include `IDLE`, +`STARTING`, `RECORDING`, `PAUSED`, and `STOPPING`. -## Start a recording +### Starting a Recording -To start a recording, you can call the `start` method in the `meeting.recording` -object. The valid states are `IDLE`, `STARTING`, `RECORDING`, and `STOPPING`. +To start a recording, use the `start()` method of the `meeting.recording` object. ```swift meeting.recording.start() ``` -## Stop a recording +### Stopping a Recording -Call `meeting.recording.stop()` to stop the active recording. +To stop an active recording, use the `stop()` method. ```swift meeting.recording.stop() ``` -## Pause a recording +### Pausing a Recording -Call `meeting.recording.pause()` to pause the active recording. +To temporarily pause a recording, use the `pause()` method. ```swift -meeting.recording.pause(); +meeting.recording.pause() ``` -## Resume a paused recording +### Resuming a Recording -Call `meeting.recording.resume()` to resume the paused recording. +To resume a paused recording, use the `resume()` method. ```swift -meeting.recording.resume(); +meeting.recording.resume() ``` -## Get active recording state +### Listening for Recording Events -The `meeting.recording.recordingState` property describes the current state of -the recording. The valid states are `IDLE`, `STARTING`, `RECORDING`, and -`STOPPING`. +To handle recording-related events, implement the `DyteRecordingEventsListener` interface. This interface provides callbacks for +various recording events: -## Listening to recording events in a meeting - -To receive recording events, you must implement methods from `DyteRecordingEventsListener`. -You can subscribe to these events by using the `meeting.addRecordingEventsListener(dyteRecordingEventsListener: listener)` method. +- `onMeetingRecordingStarted()`: Called when the recording is started or resumed, either by the user or their peer. +- `onMeetingRecordingEnded()`: Called when the recording is stopped or paused, either by the user or their peer. +- `onMeetingRecordingStateUpdated(state: DyteRecordingState)`: Notifies when there is a change in the recording state. +- `onMeetingRecordingStopError(e: Exception)`: Indicates an error occurred while stopping an active recording. +- `onMeetingRecordingPauseError(e: Exception)`: Indicates an error occurred while pausing an active recording. +- `onMeetingRecordingResumeError(e: Exception)`: Indicates an error occurred while resuming a paused recording. ```swift -extension MeetingViewModel: DyteRecordingEventsListener { - - func onMeetingRecordingEnded() { - // your code to handle recording end - } - - func onMeetingRecordingStarted() { - // your code to handle recording start - } - - func onMeetingRecordingStateUpdated(state: DyteRecordingState) { - // your code to handle recording state update - } - - func onMeetingRecordingStopError(e: KotlinException) { - // your code to handle recording stop error - } +extension MeetingViewModel: DyteRecordingEventsListener { + func onMeetingRecordingStarted() { + // Handle recording started + } + + func onMeetingRecordingEnded() { + // Handle recording stopped + } + + func onMeetingRecordingStateUpdated(state: DyteRecordingState) { + // Handle recording state update + } + + func onMeetingRecordingStopError(e: Exception) { + // Handle recording stop error + } + + func onMeetingRecordingPauseError(e: Exception) { + // Handle recording pause error + } + + func onMeetingRecordingResumeError(e: Exception) { + // Handle recording resume error + } } ``` +Implement these callbacks to handle recording events and errors appropriately in your application. + iOS Core Recording - diff --git a/docs/ios-core/release-notes.mdx b/docs/ios-core/release-notes.mdx index 6f73d35329..bd3528da63 100644 --- a/docs/ios-core/release-notes.mdx +++ b/docs/ios-core/release-notes.mdx @@ -3,13 +3,15 @@ title: Release Notes sidebar_position: 101 sidebar_class_name: releaseSidebarHeading tags: - - mobile-core + - ios-core - releasenotes --- import ReleaseNotesGenerator from '@site/src/components/ReleaseNotesGenerator'; - +The release notes lists all new features, resolved issues, and known issues of iOS Core in chronological order. + + iOS Core Release Notes diff --git a/docs/ios-core/room-metadata.mdx b/docs/ios-core/room-metadata.mdx new file mode 100644 index 0000000000..482985b653 --- /dev/null +++ b/docs/ios-core/room-metadata.mdx @@ -0,0 +1,47 @@ +--- +title: Room Metadata +description: >- + Learn about managing room metadata in your iOS application using Dyte + Docs. +sidebar_position: 6 +tags: + - ios-core + - room-metadata +--- + +# Room Metadata + +All metadata pertaining to a meeting is stored in `meeting.meta`. This includes: + +- `meetingId`: The unique identifier of the meeting. +- `meetingType`: Indicates the meeting is a group-call or a webinar. +- `meetingTitle`: The title of the meeting. +- `meetingStartedTimestamp`: The timestamp when the meeting started. +- `meetingState`: The state of the meeting of type `DyteMeetingState`. +- `authToken`: The authentication token for the meeting. +- `meetingConfig`: The configuration of the meeting of type `MeetingConfig`. + +```swift +enum DyteMeetingState { + case notInitialised + case initStarted + case initCompleted + case initFailed +} + +struct MeetingConfig { + let enableAudio: Bool + let enableVideo: Bool +} +``` + +For example, if you want to get the name of the meeting the current participant is +connected to, you can do so by doing: + +```swift +let meetingTitle = meeting.meta.meetingTitle +``` + + + Mobile Core Room Metadata + diff --git a/docs/ios-core/room/_category_.json b/docs/ios-core/room/_category_.json deleted file mode 100644 index 5c77ad4b75..0000000000 --- a/docs/ios-core/room/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 5, - "label": "Room", - "collapsible": true -} diff --git a/docs/ios-core/room/room-connection-events.mdx b/docs/ios-core/room/room-connection-events.mdx deleted file mode 100644 index 507e1fa186..0000000000 --- a/docs/ios-core/room/room-connection-events.mdx +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: Room Connection Events -description: >- - Explore room connection events in iOS Core with Dyte Docs. Understand how to - leverage these events for enhanced user experiences. -sidebar_position: 2 -tags: - - mobile-core - - ios-core - - connection events - - reconnection ---- - -# Room Connection Events - -The `meeting` object emits various events to indicate changes in the connection status of the room. When a connection is lost, -the Dyte SDK detects it and attempts to reconnect the user to the meeting room automatically. - -You can subscribe to these events by implementing the `DyteMeetingRoomEventsListener` callbacks and passing the object to -the `meeting.addMeetingRoomEventsListener(dyteMeetingRoomEventsListener)`. - -The following are the room connection events: - -### Connecting to room - -When the local user starts connecting to the meeting room during initialization, this event is triggered. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onConnectingToMeetingRoom() { - - } -} -``` - -### Connected to room - -When the local user connects to the meeting room after initialization, this event is triggered. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onConnectedToMeetingRoom() { - - } -} -``` - -### Disconnected from room - -When the local user disconnects while leaving the meeting room, this event is triggered. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onDisconnectedFromMeetingRoom() { - - } -} -``` - -### Reconnecting to room - -When the Dyte SDK detects a connection drop and attempts to reconnect to the meeting room, this event is triggered. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onReconnectingToMeetingRoom() { - - } -} -``` - -### Reconnected to room - -When the local user successfully reconnects to the meeting room, this event is triggered. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onReconnectedToMeetingRoom() { - - } -} -``` - -### Room connection failed - -When the local user fails to connect to the meeting room during initialization, this event is triggered. This might occur -because of internet connection issues. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onMeetingRoomConnectionFailed() { - - } -} -``` - -### Room reconnection failed - -When the local user fails to reconnect to the meeting room, this event is triggered. This occurs when the local user's -internet connection goes down for an extended period of time and the Dyte SDK is unable to reconnect despite multiple attempts. - -```swift -extension DyteEventSelfListner: DyteMeetingRoomEventsListener { - func onMeetingRoomReconnectionFailed() { - - } -} -``` - - - iOS Core Room Connection Events - - diff --git a/docs/ios-core/room/room-metadata.mdx b/docs/ios-core/room/room-metadata.mdx deleted file mode 100644 index 2821cd6bfd..0000000000 --- a/docs/ios-core/room/room-metadata.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Room Metadata -description: >- - Learn about room metadata in iOS Core with Dyte Docs. Enhance your app's - capabilities by utilizing and managing room-specific information. -sidebar_position: 1 -tags: - - mobile-core - - room-metadata ---- - -# Room Metadata - -All metadata pertaining to a meeting is stored in `meeting.meta`. This includes: - -- `roomName`: The name of the room the current participant is connected to. -- `roomType`: Indicates the meeting is a group-call or a webinar. -- `meetingTitle`: The title of the meeting. -- `meetingStartedTimestamp`: The timestamp when the meeting started. - -For example, if you want to get the name of the room the current participant is -connected to, you can do so by doing: - -```swift -let roomName = meeting.meta.roomName - -if meeting.localUser.roomJoined { - print("The local user has joined room \(roomName).") -} -``` - - - iOS Core Room Metadata - - diff --git a/docs/ios-core/stage-management/1-introduction.mdx b/docs/ios-core/stage-management/1-introduction.mdx new file mode 100644 index 0000000000..b79225fa9d --- /dev/null +++ b/docs/ios-core/stage-management/1-introduction.mdx @@ -0,0 +1,125 @@ +--- +title: Introduction +description: Stage management in Dyte meetings. +sidebar_position: 1 +tags: + - ios-core + - stage +--- + +_Below documentation is relevant for Interactive Livestream(LHLS) and Webinar(WebRTC) use cases._ + +Instead of a traditional publish-subscribe model, where a user can publish their media and others can choose to subscribe, Dyte +comes with an optional managed configuration. In this managed configuration, a less privileged user can be configured with a +default behavior to not publish media. The user can then request permission to publish their media, which a privileged user can +choose to grant or deny. + +### Accessing the Stage APIs + +Dyte's stage management APIs allow users to perform actions such as joining and leaving the stage, managing stage requests and +permissions, and kicking participants from the stage. These APIs are accessible through the `meeting.stage` object. + +### Stage Status + +In meetings where stage management is enabled, a user's stage status can change within the values represented by the `DyteStageStatus` +enum. These status values include: + +- `ON_STAGE`: Indicates that the user is currently on the stage and is allowed to publish media. +- `OFF_STAGE`: Indicates that the user is a viewer and is not on the stage. They can see and listen to those on stage. +- `REQUESTED_TO_JOIN_STAGE`: Indicates that the user has a pending request to join the stage. This status is assigned to the user + until the host accepts or rejects their request. +- `ACCEPTED_TO_JOIN_STAGE`: Indicates that the host has accepted the user's request to join the stage. +- `REJECTED_TO_JOIN_STAGE`: Indicates that the host has rejected the user's request to join the stage. The user can request again + to join from this status. + +The `meeting.stage.status` property provides the current stage status of the local user. + +### Viewers + +You can retrieve a list of off-stage participants (viewers) in a stage-enabled meeting by accessing the `meeting.stage.viewers` +property. This property provides a list of `DyteJoinedMeetingParticipant` objects whose stage status is not `ON_STAGE`. + +### Joining the Stage + +To interact with peers and publish media, users can join the stage. This action is only possible if the user's preset allows them +to publish media or if their request to join the stage has been accepted by a host (i.e., their stage status is `ACCEPTED_TO_JOIN_STAGE`). + +```swift +meeting.stage.join() +``` + +### Leaving the Stage + +When users want to stop interacting with peers, they can leave the stage. This action stops their media from being published, +and their audio and video are no longer received by others in the room. + +```swift +meeting.stage.leave() +``` + +### List of Stage Events + +The `DyteStageEventListener` interface provides callback methods for various stage events. Implement these callbacks to handle +stage-related events in your application: + +```swift +extension WebinarViewModel: DyteStageEventListener { + func onPresentRequestReceived() { + // Called when the local user's stage access request is accepted by the host, + // or when the local user, who is a viewer, is invited to the stage by the host. + } + + func onAddedToStage() { + // Called when the local user successfully joins the stage. + } + + func onRemovedFromStage() { + // Called when the local user is removed from the stage. + } + + func onPresentRequestAdded(participant: DyteJoinedMeetingParticipant) { + // Called when a participant requests to join the stage. Triggered only if the local user is a host. + } + + func onPresentRequestClosed(participant: DyteJoinedMeetingParticipant) { + // Called when a participant with a pending stage access request leaves the meeting. + // Triggered only if the local user is a host. + } + + func onPresentRequestRejected(participant: DyteJoinedMeetingParticipant) { + // Called when a participant's stage access request is denied by the host. + // Triggered only if the local user is a host. + } + + func onPresentRequestWithdrawn(participant: DyteJoinedMeetingParticipant) { + // Called when a participant cancels their stage access request. + // Triggered only if the local user is a host. + } + + func onParticipantRemovedFromStage(participant: DyteJoinedMeetingParticipant) { + // Called when a participant is removed from the stage by the host. + } + + func onStageRequestsUpdated(accessRequests: [DyteJoinedMeetingParticipant]) { + // Called when the list of stage access requests is updated. + } + + func onParticipantStartedPresenting(participant: DyteJoinedMeetingParticipant) { + // Called when a participant joins the stage. + } + + func onParticipantStoppedPresenting(participant: DyteJoinedMeetingParticipant) { + // Called when a participant leaves the stage. + } + + func onStageStatusUpdated(stageStatus: DyteStageStatus) { + // Called when the local user's stage status is updated. + } +} +``` + +Next, we'll explore the Stage Management APIs for hosts, allowing them to manage stage requests, participants in Dyte meetings. + + + iOS Core Stage Introduction + diff --git a/docs/ios-core/stage-management/2-host-controls.mdx b/docs/ios-core/stage-management/2-host-controls.mdx new file mode 100644 index 0000000000..4ac6629c30 --- /dev/null +++ b/docs/ios-core/stage-management/2-host-controls.mdx @@ -0,0 +1,89 @@ +--- +title: Stage Host Controls +description: Stage management APIs for Host in Dyte meetings. +sidebar_position: 2 +tags: + - ios-core + - stage +--- + +In a stage management-enabled meeting, a user with the `selfPermissions.host.canAcceptStageRequests` permission as `true` is +considered a host. The `meeting.stage` object in Dyte's iOS Core SDK provides stage management APIs that allow hosts to +manage stage access requests, invite participants to the stage, and remove participants from the stage. + +### List of Stage Access Requests + +You can retrieve the list of pending stage access requests by accessing the `meeting.stage.accessRequests` property. This property +provides a list of `DyteJoinedMeetingParticipant` objects who have requested stage access. + +**Note**: If the local user is not a host, this property returns an empty list. + +### Grant Access + +To accept stage access requests or allow a participant directly to the stage, you can use the `grantAccess()` method. +Alternatively, the `grantAccessAll()` method can be used to grant stage access to all participants with pending stage access requests. + +```swift +// Grants stage access to a participant +// id: peer id of the stage access requesting participant +meeting.stage.grantAccess(id) + +// Grants stage access to all participants with pending stage access requests +meeting.stage.grantAccessAll() +``` + +### Deny Access + +To reject stage access requests, you can use the `denyAccess()` method. Similarly, the `denyAccessAll()` method can be used to +deny all pending stage access requests. + +```swift +// Denies stage access request of a participant +// id: peer id of the stage access requesting participant +meeting.stage.denyAccess(id) + +// Denies all pending stage access requests +meeting.stage.denyAccessAll() +``` + +### Kick Users + +You can remove a participant from the stage by using the `kick()` method. + +```swift +// Kicks a participant from stage +// id: peer id of the ON_STAGE participant to kick +meeting.stage.kick(id) +``` + +### Listening to Stage Access Requests + +You can listen to incoming stage access requests or changes in the access requests list if you are a host. The SDK provides the +following callbacks to `DyteStageEventListener`: + +```swift +extension WebinarViewModel: DyteStageEventListener { + func onPresentRequestAdded(participant: DyteStageParticipant) { + // Called when a user is requesting to join the stage + } + + func onPresentRequestClosed(participant: DyteStageParticipant) { + // Called when a user who was trying to join the stage leaves the call + } + + func onPresentRequestRejected(participant: DyteStageParticipant) { + // Called when a join stage request is denied by the host + } + + func onPresentRequestWithdrawn(participant: DyteStageParticipant) { + // Called when a user who was trying to join the stage withdraws their request to join + } + + func onStageRequestsUpdated(accessRequests: [DyteJoinedMeetingParticipant]) { + // Called when the access requests list is updated + } +} +``` + +These APIs enable you to manage stage access requests and participants effectively in Dyte meetings. Next, we'll explore the +Stage APIs available to Viewer participants. diff --git a/docs/ios-core/stage-management/3-viewer-participants.mdx b/docs/ios-core/stage-management/3-viewer-participants.mdx new file mode 100644 index 0000000000..bd09754a90 --- /dev/null +++ b/docs/ios-core/stage-management/3-viewer-participants.mdx @@ -0,0 +1,42 @@ +--- +title: Stage Access for Viewers +description: Stage APIs for Viewers in Dyte meetings. +sidebar_position: 3 +tags: + - ios-core + - stage +--- + +Viewer participants in a stage-enabled meeting are users whose preset permission for media production is set as `CAN_REQUEST`. +The `meeting.stage` object provides APIs for viewer participants to request stage access and withdraw their join stage request. + +### Request Access + +To request access to the stage, you can call the `requestAccess()` method: + +```swift +meeting.stage.requestAccess() +``` + +When a host accepts the user's stage access request or allows the user directly to the stage, the SDK triggers the +`onPresentRequestReceived` callback in `DyteStageEventListener`. You can listen to this event: + +```swift +extension WebinarViewModel: DyteStageEventListener { + func onPresentRequestReceived() { + // Host accepted the join stage request or invited user directly to stage + } +} +``` + +You can then call the `join()` method to finally join the stage. + +**Note**: If the host has directly allowed the user to join the stage and they want to decline, you should use the `leave()` method. + +### Cancel Access Request + +To cancel or withdraw a pending stage access request, you can call the `cancelRequestAccess()` method: + +```swift +meeting.stage.cancelRequestAccess() +``` diff --git a/docs/ios-core/stage-management/_category_.json b/docs/ios-core/stage-management/_category_.json new file mode 100644 index 0000000000..753fc8761b --- /dev/null +++ b/docs/ios-core/stage-management/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 9, + "label": "Stage Management", + "collapsible": true +} \ No newline at end of file diff --git a/docs/ios-core/waitlist-events.mdx b/docs/ios-core/waitlist-events.mdx deleted file mode 100644 index 8cf779d8a1..0000000000 --- a/docs/ios-core/waitlist-events.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Waitlist Events -description: >- - Discover how to handle waitlist events in iOS Core with Dyte Docs. Optimize - your app's performance by effectively managing waitlisted users. -sidebar_position: 10 -tags: - - mobile-core - - waitlist ---- - -### Waitlist Events Listener - -To listen for waitlisting events, implement `DyteWaitlistEventsListener` on the `meeting` object. - -```swift -meeting.addWaitlistEventListener(waitlistEventListener: self) -``` - -When registered, callbacks can be observed as follows: - -```swift - -extension MeetingViewModel: DyteWaitlistEventsListener { - - func onWaitListParticipantJoined(participant: DyteMeetingParticipant) { - // triggered when waitList peer is joined - } - - func onWaitListParticipantAccepted(participant: DyteMeetingParticipant) { - // triggered when waitListed peer is accepted by host - } - - func onWaitListParticipantRejected(participant: DyteMeetingParticipant) { - // triggered when entry of waitListed peer declined by host - } - - func onWaitListParticipantClosed(participant: DyteMeetingParticipant) { - // triggered when waitListed peer get's disconnected - } -} -``` - - - iOS Core Waitlist Events - - diff --git a/docs/ios-core/webinar/_category_.json b/docs/ios-core/webinar/_category_.json deleted file mode 100644 index ad471a6505..0000000000 --- a/docs/ios-core/webinar/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "position": 8, - "label": "Webinar", - "collapsible": true -} diff --git a/docs/ios-core/webinar/introduction.mdx b/docs/ios-core/webinar/introduction.mdx deleted file mode 100644 index bfe1c017f3..0000000000 --- a/docs/ios-core/webinar/introduction.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: Join and Leave Stage using Dyte's Webinar Platform -description: >- - Get introduced to webinars in iOS Core with Dyte Docs. Explore the features - and benefits of integrating webinars into your app. -sidebar_position: 1 -tags: - - mobile-core - - webinar ---- - -# Join and Leave Stage using Dyte's Webinar Platform - -This topic provides a comprehensive guide on performing stage management and participant control within Dyte's webinar platform. - -In Dyte, the webinar object, is accessible through the `meeting.webinar` property. This provides a range of methods to efficiently manage the stage and participants during webinar sessions, such as joining and leaving the stage, as well as access control for participants. Additionally, you can also retrieve the list of viewers who have joined the webinar from the `meeting.webinar.viewers` array, and monitor participant requests to join the stage through the `meeting.webinar.requestedParticipants` array. - -## Join stage - -To join the stage in a webinar, specific permissions are required, which are managed through `Presets`. To determine if you have the necessary permissions, use the following command: - -```swift -meeting.webinar.canJoinStage() -``` - -Once you have the permissions to join the stage, you can start presenting in the webinar. There are two distinct flows for this process. - -Participants with the media preset set to "Allowed" can join the stage directly without needing the host to accept their request. However, participants with the media preset set to "Need to Request" must wait for the host to approve their request. Once the host grants permission, these participants can start producing media. - -To join the stage, use the following function: - -```swift -meeting.webinar.joinStage() -``` - -## Leave stage - -To leave the stage, use the following function: - -```swift -meeting.webinar.leaveStage() -``` - - - iOS Core Join and Leave Stage using Dyte's Webinar Platform - - diff --git a/docs/ios-core/webinar/stage-management.mdx b/docs/ios-core/webinar/stage-management.mdx deleted file mode 100644 index 909a9bec2c..0000000000 --- a/docs/ios-core/webinar/stage-management.mdx +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Manage Stage in Dyte's Webinar -description: >- - Learn how to effectively manage webinar stages in iOS Core with Dyte Docs. - Elevate the quality of your app's webinar experiences. -sidebar_position: 3 -tags: - - mobile-core - - webinar ---- - -# Manage Stage in Dyte's Webinar - -In the webinar, both hosts and participants have the ability to manage the stage. This allows for seamless control and organization of the webinar session. - -## Host stage management - -In Dyte's webinar platform, hosts have the capability to request participants to join the stage. When a host sends a request to a participant, the participant will receive a callback in the `DyteWebinarEventsListener#onPresentRequestReceived()` method. The participant can then choose to accept or decline the request using specific functions. - -```swift -extension MeetingViewModel: DyteWebinarEventsListener { - ... - func onPresentRequestReceived() { - // when host requests this user to join stage. Here one should give choice to either accept the request or decline it. - } - ... -} -meeting.addWebinarEventsListener(webinarEventsListener: meetingModel) -``` - -To accept the request and join the stage, participants can utilize the following command: - -```swift -meeting.webinar.acceptRequestToPresent() -``` - -Alternatively, if participants wish to decline the request and not join the stage, use the following command: - -```swift -meeting.webinar.rejectRequestToPresent() -``` - -## Participant stage management - -Participants with the "Accept requests" setting enabled in the Preset can manage the stage in the webinar. - -### Access the list of requests - -To access the list of requests received to join the stage, you can utilize the `meeting.webinar.requestedParticipants` API. This provides you with the necessary information about the participants who have requested to join the stage. - -```swift -meeting.webinar.requestedParticipants -``` - -### Listen to the incoming requests - -Once you are in the meeting, you can register a listener in the meeting object to listen for incoming requests. - -```swift -extension MeetingViewModel: DyteWebinarEventsListener { - func onAddedToStage() { - // when this user is joined to stage - } - func onPresentRequestClosed(participant: RequestToPresentParticipant) { - // when a user who was trying to join stage leaves the call. - } - func onPresentRequestReceived() { - // when host requests this user to join stage. Here one should give choice to either accept the request or decline it. - } - func onPresentRequestAccepted(participant: RequestToPresentParticipant) { - // when a join stage request is accepted by host - } - func onPresentRequestAdded(participant: RequestToPresentParticipant) { - // when a user is requesting to join the stage - } - func onPresentRequestRejected(participant: RequestToPresentParticipant) { - // when a join stage request is denied by host - } - func onPresentRequestWithdrawn(participant: RequestToPresentParticipant) { - // when a user who was trying to join stage withdraws their request to join. - } - func onRemovedFromStage() { - // when this user is no longer on stage - } -} -meeting.addWebinarEventsListener(webinarEventsListener: meetingModel) -``` - -### Accept stage requests - -To accept a request to join the stage, call the following function, where `id` represents the unique identifier of the request. - -```swift -meeting.webinar.acceptRequest(id) -meeting.webinar.acceptAllRequest() -``` - -### Reject a request - -To reject a request, call the following function: - -```swift -meeting.webinar.rejectRequest(id) -meeting.webinar.rejectAllRequest() -``` - -:::note -It's important to note that if a participant doesn't have the permission to perform these operations, the SDK will throw an `UnsupportedOperationException` -::: - - - iOS Core Manage Stage in Dyte's Webinar - - diff --git a/docusaurus.config.js b/docusaurus.config.js index 00db84925f..261924cdd1 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -244,10 +244,15 @@ const plugins = [ '/guides/capabilities/misc/livestreaming-other-platforms' ) ) { - return ['/guides/capabilities/livestreaming-other-platforms', '/guides/capabilities/recording/livestream-recording']; + return [ + '/guides/capabilities/livestreaming-other-platforms', + '/guides/capabilities/recording/livestream-recording', + ]; } - if (path.startsWith('/guides/capabilities/video/add-virtual-background')) { + if ( + path.startsWith('/guides/capabilities/video/add-virtual-background') + ) { return [ '/guides/capabilities/middleware/add-virtual-background', '/guides/capabilities/customization/add-virtual-background', @@ -445,7 +450,7 @@ const config = { plugins, trailingSlash: false, - themes: ['@docusaurus/theme-live-codeblock','@docusaurus/theme-mermaid'], + themes: ['@docusaurus/theme-live-codeblock', '@docusaurus/theme-mermaid'], clientModules: [require.resolve('./src/client/define-ui-kit.js')], scripts: [{ src: 'https://cdn.statuspage.io/se-v2.js', async: true }], markdown: { @@ -637,7 +642,7 @@ const config = { 'swift', 'objectivec', 'json', - 'bash' + 'bash', ], magicComments: [ { diff --git a/src/sections.ts b/src/sections.ts index 8133a78046..6b9f833c42 100644 --- a/src/sections.ts +++ b/src/sections.ts @@ -11,13 +11,13 @@ import { export type Section = { docId: string } & ( | { - section: false; - } + section: false; + } | { - section: string; - icon: (props: ComponentProps<'svg'>) => ReactNode; - name: string; - } + section: string; + icon: (props: ComponentProps<'svg'>) => ReactNode; + name: string; + } ); const SECTIONS: Section[] = [ @@ -84,7 +84,6 @@ const SECTIONS: Section[] = [ icon: AndroidIcon, section: 'mobile-core', }, - { name: 'iOS Core', docId: 'ios-core',