diff --git a/calls/ios/audio-modes.mdx b/calls/ios/audio-modes.mdx index 9f1d04c91..8219cd011 100644 --- a/calls/ios/audio-modes.mdx +++ b/calls/ios/audio-modes.mdx @@ -43,7 +43,7 @@ CometChatCalls.joinSession( ```objectivec SessionSettings *sessionSettings = [[[CometChatCalls sessionSettingsBuilder] - setAudioMode:AudioModeTypeSpeaker] + setAudioMode:AudioModeSpeaker] build]; [CometChatCalls joinSessionWithSessionID:sessionId @@ -113,8 +113,8 @@ class CallViewController: UIViewController, MediaEventsListener { CallSession.shared.removeMediaEventsListener(self) } - func onAudioModeChanged(audioModeType: AudioModeType) { - switch audioModeType { + func onAudioModeChanged(audioMode: AudioMode) { + switch audioMode { case .speaker: print("Switched to speaker") case .earpiece: @@ -127,7 +127,7 @@ class CallViewController: UIViewController, MediaEventsListener { break } // Update audio mode button icon - updateAudioModeIcon(audioModeType) + updateAudioModeIcon(audioMode) } // Other callbacks... @@ -159,9 +159,9 @@ class CallViewController: UIViewController, MediaEventsListener { [[CallSession shared] removeMediaEventsListener:self]; } -- (void)onAudioModeChangedWithAudioModeType:(AudioModeType)audioModeType { +- (void)onAudioModeChangedWithAudioMode:(AudioMode)audioMode { // Update audio mode button icon - [self updateAudioModeIcon:audioModeType]; + [self updateAudioModeIcon:audioMode]; } // Other callbacks... @@ -187,7 +187,7 @@ let sessionSettings = CometChatCalls.sessionSettingsBuilder ```objectivec SessionSettings *sessionSettings = [[[[CometChatCalls sessionSettingsBuilder] - setAudioMode:AudioModeTypeSpeaker] + setAudioMode:AudioModeSpeaker] hideAudioModeButton:YES] build]; ``` diff --git a/calls/ios/custom-control-panel.mdx b/calls/ios/custom-control-panel.mdx index e38d02327..c5c4e09c5 100644 --- a/calls/ios/custom-control-panel.mdx +++ b/calls/ios/custom-control-panel.mdx @@ -361,7 +361,7 @@ extension CallViewController: MediaEventsListener { func onRecordingStopped() {} func onScreenShareStarted() {} func onScreenShareStopped() {} - func onAudioModeChanged(audioModeType: AudioModeType) {} + func onAudioModeChanged(audioMode: AudioMode) {} func onCameraFacingChanged(cameraFacing: CameraFacing) {} } ``` diff --git a/calls/ios/events.mdx b/calls/ios/events.mdx index 9440bd09a..64e67b8a4 100644 --- a/calls/ios/events.mdx +++ b/calls/ios/events.mdx @@ -279,7 +279,7 @@ class CallViewController: UIViewController, MediaEventsListener { func onScreenShareStarted() {} func onScreenShareStopped() {} - func onAudioModeChanged(audioModeType: AudioModeType) { + func onAudioModeChanged(audioMode: AudioMode) { // Audio output device changed } @@ -329,7 +329,7 @@ class CallViewController: UIViewController, MediaEventsListener { // Call recording stopped } -- (void)onAudioModeChangedWithAudioModeType:(AudioModeType)audioModeType { +- (void)onAudioModeChangedWithAudioMode:(AudioMode)audioMode { // Audio output device changed } @@ -354,11 +354,11 @@ class CallViewController: UIViewController, MediaEventsListener { | `onRecordingStopped` | - | Call recording stopped | | `onScreenShareStarted` | - | You started screen sharing | | `onScreenShareStopped` | - | You stopped screen sharing | -| `onAudioModeChanged` | `AudioModeType` | Audio output device changed | +| `onAudioModeChanged` | `AudioMode` | Audio output device changed | | `onCameraFacingChanged` | `CameraFacing` | Camera switched between front and back | - + | Value | Description | |-------|-------------| | `.speaker` | Audio routed through device loudspeaker | diff --git a/calls/ios/idle-timeout.mdx b/calls/ios/idle-timeout.mdx index 0cd70de52..887a15f6d 100644 --- a/calls/ios/idle-timeout.mdx +++ b/calls/ios/idle-timeout.mdx @@ -36,7 +36,7 @@ Set the idle timeout period using `setIdleTimeoutPeriod()` in `SessionSettingsBu ```swift let sessionSettings = CometChatCalls.sessionSettingsBuilder .setIdleTimeoutPeriod(120) // 2 minutes - .setType(.video) + .setSessionType(.video) .build() CometChatCalls.joinSession( diff --git a/calls/ios/join-session.mdx b/calls/ios/join-session.mdx index 8c4bfd0f8..f7bda4efb 100644 --- a/calls/ios/join-session.mdx +++ b/calls/ios/join-session.mdx @@ -62,7 +62,7 @@ let sessionId = "SESSION_ID" let sessionSettings = CometChatCalls.sessionSettingsBuilder .setDisplayName("John Doe") - .setType(.video) + .setSessionType(.video) .build() CometChatCalls.joinSession( @@ -162,7 +162,7 @@ Use the generated token to join the session. This gives you control over when an ```swift let sessionSettings = CometChatCalls.sessionSettingsBuilder .setDisplayName("John Doe") - .setType(.video) + .setSessionType(.video) .build() // Use the previously generated token @@ -221,7 +221,7 @@ CometChatCalls.generateToken(sessionID: sessionId, onSuccess: { [weak self] toke // Step 2: Join with token let sessionSettings = CometChatCalls.sessionSettingsBuilder .setDisplayName("John Doe") - .setType(.video) + .setSessionType(.video) .build() CometChatCalls.joinSession( diff --git a/calls/ios/migration-guide-v5.mdx b/calls/ios/migration-guide-v5.mdx index 6f90b986e..36e29a24a 100644 --- a/calls/ios/migration-guide-v5.mdx +++ b/calls/ios/migration-guide-v5.mdx @@ -32,7 +32,7 @@ While v4 APIs will continue to work, migrating to v5 APIs gives you: - **Granular event listeners** — 5 focused listener protocols instead of one monolithic `CallsEventsDelegate` - **`CallSession` singleton** for cleaner session control — all actions on a single object instead of scattered static methods - **Dedicated `login()` method** — the Calls SDK now handles its own authentication instead of depending on the Chat SDK's auth token or REST APIs -- **Strongly-typed enums** — `AudioModeType`, `CallType`, `LayoutType`, `CameraFacing` instead of raw strings +- **Strongly-typed enums** — `AudioMode`, `CallType`, `LayoutType`, `CameraFacing` instead of raw strings --- @@ -41,9 +41,10 @@ While v4 APIs will continue to work, migrating to v5 APIs gives you: No changes required. The `init` API is the same in v5. ```swift -let callAppSettings = CallAppSettings() -callAppSettings.set(appId: "APP_ID") -callAppSettings.set(region: "REGION") +let callAppSettings = CallAppSettingsBuilder() + .set(appID: "APP_ID") + .set(region: "REGION") + .build() CometChatCalls(callsAppSettings: callAppSettings, onSuccess: { success in // Initialized @@ -118,7 +119,7 @@ let callSettings = CometChatCalls.callSettingsBuilder ```swift let sessionSettings = CometChatCalls.sessionSettingsBuilder - .setType(.audio) + .setSessionType(.audio) .startAudioMuted(false) .startVideoPaused(false) .setLayout(.tile) @@ -334,7 +335,7 @@ class MyMediaListener: MediaEventsListener { func onVideoResumed() { } func onRecordingStarted() { } func onRecordingStopped() { } - func onAudioModeChanged(audioModeType: AudioModeType) { } + func onAudioModeChanged(audioMode: AudioMode) { } func onCameraFacingChanged(cameraFacing: CameraFacing) { } } callSession.addMediaEventsListener(myMediaListener) @@ -373,7 +374,7 @@ v5 listeners use weak references internally, so they are automatically cleaned u | `onUserJoined(rtcUser:)` | `ParticipantEventListener` | `onParticipantJoined(participant:)` | | `onUserLeft(rtcUser:)` | `ParticipantEventListener` | `onParticipantLeft(participant:)` | | `onUserListChanged(rtcUsers:)` | `ParticipantEventListener` | `onParticipantListChanged(participants:)` | -| `onAudioModeChanged(mode:)` | `MediaEventsListener` | `onAudioModeChanged(audioModeType:)` | +| `onAudioModeChanged(mode:)` | `MediaEventsListener` | `onAudioModeChanged(audioMode:)` | | `onCallSwitchedToVideo(callSwitchedInfo:)` | *Removed* | — | | `onUserMuted(rtcMutedUser:)` | `ParticipantEventListener` | `onParticipantAudioMuted(participant:)` | | `onRecordingToggled(recordingInfo:)` | `MediaEventsListener` | `onRecordingStarted()` / `onRecordingStopped()` | diff --git a/calls/ios/recording.mdx b/calls/ios/recording.mdx index ab514ce5f..cbdf48415 100644 --- a/calls/ios/recording.mdx +++ b/calls/ios/recording.mdx @@ -124,7 +124,7 @@ class CallViewController: UIViewController, MediaEventsListener { func onVideoResumed() {} func onScreenShareStarted() {} func onScreenShareStopped() {} - func onAudioModeChanged(audioModeType: AudioModeType) {} + func onAudioModeChanged(audioMode: AudioMode) {} func onCameraFacingChanged(cameraFacing: CameraFacing) {} } ``` diff --git a/calls/ios/ringing.mdx b/calls/ios/ringing.mdx index efe23875f..3df58dcf3 100644 --- a/calls/ios/ringing.mdx +++ b/calls/ios/ringing.mdx @@ -115,7 +115,7 @@ extension CallViewController: CometChatCallDelegate { func onIncomingCallReceived(incomingCall: Call?, error: CometChatException?) { guard let call = incomingCall else { return } - print("Incoming call from: \(call.callInitiator?.name ?? "")") + print("Incoming call from: \((call.callInitiator as? User)?.name ?? "")") // Show incoming call UI with accept/reject options } @@ -150,7 +150,7 @@ NSString *listenerID = @"UNIQUE_LISTENER_ID"; // Implement CometChatCallDelegate - (void)onIncomingCallReceivedWithIncomingCall:(Call *)incomingCall error:(CometChatException *)error { - NSLog(@"Incoming call from: %@", incomingCall.callInitiator.name); + NSLog(@"Incoming call from: %@", ((User *)incomingCall.callInitiator).name); // Show incoming call UI with accept/reject options } @@ -235,7 +235,7 @@ Reject an incoming call: ```swift func rejectIncomingCall(sessionId: String) { - let status: CometChat.CallStatus = .rejected + let status: CometChat.callStatus = .rejected CometChat.rejectCall(sessionID: sessionId, status: status, onSuccess: { call in print("Call rejected") @@ -270,7 +270,7 @@ Cancel an outgoing call before it's answered: ```swift func cancelOutgoingCall(sessionId: String) { - let status: CometChat.CallStatus = .cancelled + let status: CometChat.callStatus = .cancelled CometChat.rejectCall(sessionID: sessionId, status: status, onSuccess: { call in print("Call cancelled") @@ -306,7 +306,7 @@ After accepting a call (or when your outgoing call is accepted), join the call s ```swift func joinCallSession(sessionId: String) { let sessionSettings = CometChatCalls.sessionSettingsBuilder - .setType(.video) + .setSessionType(.video) .build() CometChatCalls.joinSession( diff --git a/calls/ios/session-settings.mdx b/calls/ios/session-settings.mdx index 6a8e32243..e69fb842f 100644 --- a/calls/ios/session-settings.mdx +++ b/calls/ios/session-settings.mdx @@ -19,7 +19,7 @@ These are pre-session configurations that must be set before joining a call. Onc let sessionSettings = CometChatCalls.sessionSettingsBuilder .setTitle("Team Meeting") .setDisplayName("John Doe") - .setType(.video) + .setSessionType(.video) .setLayout(.tile) .startAudioMuted(false) .startVideoPaused(false) @@ -97,7 +97,7 @@ Defines the type of call session. Choose `.video` for video calls with camera en ```swift -.setType(.video) +.setSessionType(.video) ``` @@ -220,7 +220,7 @@ Controls whether the camera is turned off when joining the session. Set to `true ### Audio Mode -**Method:** `setAudioMode(_ audioMode: AudioModeType)` +**Method:** `setAudioMode(_ audioMode: AudioMode)` Sets the initial audio output device for the call. Options include `.speaker` for loudspeaker, `.earpiece` for phone earpiece, `.bluetooth` for connected Bluetooth devices, or `.headphones` for wired headphones. @@ -232,16 +232,16 @@ Sets the initial audio output device for the call. Options include `.speaker` fo ```objectivec -[builder setAudioMode:AudioModeTypeSpeaker] +[builder setAudioMode:AudioModeSpeaker] ``` | Parameter | Type | Default | |-----------|------|---------| -| `audioMode` | AudioModeType | .speaker | +| `audioMode` | AudioMode | .speaker | - + | Value | Description | |-------|-------------| | `.speaker` | Device loudspeaker | @@ -633,7 +633,7 @@ Hides the button that opens the in-call chat interface. Set to `false` to show t | `LayoutType` | `.tile` | Grid layout showing all participants equally | | | `.spotlight` | Focus on active speaker with others in sidebar | | | `.sidebar` | Main speaker with participants in a sidebar | -| `AudioModeType` | `.speaker` | Device loudspeaker | +| `AudioMode` | `.speaker` | Device loudspeaker | | | `.earpiece` | Phone earpiece | | | `.bluetooth` | Connected Bluetooth device | | | `.headphones` | Wired headphones | diff --git a/calls/ios/setup.mdx b/calls/ios/setup.mdx index 98c54f2ea..e9581e365 100644 --- a/calls/ios/setup.mdx +++ b/calls/ios/setup.mdx @@ -44,7 +44,7 @@ pod install ### Using Swift Package Manager 1. In Xcode, go to **File > Add Package Dependencies** -2. Enter the repository URL: `https://github.com/cometchat/cometchat-calls-sdk-ios` +2. Enter the repository URL: `https://github.com/cometchat/calls-sdk-ios` 3. Select the version and add to your target ## Add Permissions @@ -84,7 +84,7 @@ The `CallAppSettings` class configures the SDK initialization: | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `appId` | String | Yes | Your CometChat App ID | -| `region` | String | Yes | Your app region (`us` or `eu`) | +| `region` | String | Yes | Your app region — `us`, `eu` or `in` | @@ -92,11 +92,11 @@ The `CallAppSettings` class configures the SDK initialization: import CometChatCallsSDK let appId = "APP_ID" // Replace with your App ID -let region = "REGION" // Replace with your Region ("us" or "eu") +let region = "REGION" // Replace with your Region ("us", "eu" or "in") let callAppSettings = CallAppSettingsBuilder() - .setAppId(appId) - .setRegion(region) + .set(appID: appId) + .set(region: region) .build() CometChatCalls(callsAppSettings: callAppSettings, onSuccess: { message in @@ -111,7 +111,7 @@ CometChatCalls(callsAppSettings: callAppSettings, onSuccess: { message in @import CometChatCallsSDK; NSString *appId = @"APP_ID"; // Replace with your App ID -NSString *region = @"REGION"; // Replace with your Region ("us" or "eu") +NSString *region = @"REGION"; // Replace with your Region ("us", "eu" or "in") CallAppSettings *callAppSettings = [[[CallAppSettingsBuilder alloc] init] setAppId:appId]