-
Notifications
You must be signed in to change notification settings - Fork 3
ApplicationCall
applicationCallEventListener: ApplicationCallEventListener?
networkQualityEventListener: NetworkQualityEventListener?
participantNetworkQualityEventListener: ParticipantNetworkQualityEventListener?
reconnectHandler: ReconnectHandler?
audioDeviceManager: AudioDeviceManager
options: ApplicationCallOptions
status: CallStatus
id() -> String
customData() -> CustomData
duration() -> Int
startTime() -> Date?
establishTime() -> Date?
endTime() -> Date?
callsConfigurationId() -> String
participants() -> [Participant]
remoteVideos() -> [String:RemoteVideo]
mute(_ shouldMute: Bool) throws -> Void
muted() -> Bool
speakerphone(_ speakerphone: Bool, _ completionHandler: @escaping (Error?) -> Void)
speakerphone() -> Bool
sendDTMF(_ dtmf: String) throws -> Void
cameraVideo(cameraVideo: Bool) throws -> Void
hasCameraVideo() -> Bool
screenShare(screenShare: Bool) throws -> Void
hasScreenShare() -> Bool
localCameraTrack() -> VideoTrack?
localScreenShareTrack() -> VideoTrack?
cameraOrientation(_ cameraOrientation: CameraOrientation) -> Void
cameraOrientation() -> CameraOrientation
pauseIncomingVideo() throws -> Void
resumeIncomingVideo() throws -> Void
audioQualityMode(_ mode: AudioQualityMode) -> Void
dataChannel() -> DataChannel?
videoFilter(_ videoFilter: VideoFilter?) -> Void
videoFilter() -> VideoFilter?
clearVideoFilter() -> Void
hangup()
recordingState() -> RecordingState
Writable property representing the call event listener which will receive application call events.
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Set the application call event listener to be handled by 'self'
applicationCall?.applicationCallEventListener = self
// Get the application call event listener
let applicationCallEventListener = applicationCall?.applicationCallEventListener
Writable property representing the event listener for local network quality events.
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Set the network quality event listener to be handled by 'self'
applicationCall?.networkQualityEventListener = self
// Get the network quality event listener
let networkQualityEventListener = applicationCall?.networkQualityEventListener
Writable property representing the event listener for other participant's network quality events.
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Set the participant network quality event listener to be handled by 'self'
applicationCall?.participantNetworkQualityEventListener = self
// Get the participant network quality event listener
let participantNetworkQualityEventListener = applicationCall?.participantNetworkQualityEventListener
Writable property representing the ReconnectHandler
. If you want to
receive CallReconnectingEvent
and CallReconnectedEvent
, you
must set this property with your custom implementation of the ReconnectHandler
.
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Set the reconnect handler to be handled by 'self'
applicationCall?.reconnectHandler = self
// Get the reconnect handler
let reconnectHandler = applicationCall?.reconnectHandler
Read-only property representing the audio device manager which is responsible for handling audio devices during the call.
// Retrieve the active application call and get the audio device manager
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let audioDeviceManager = applicationCall?.audioDeviceManager
Read-only property representing the call options which the call was started with.
// Retrieve the active application call and get the call options
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let options = applicationCall?.options
Read-only property representing the status of the call.
// Retrieve the active application call and get the status
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let status = applicationCall?.status
Returns a unique call identifier.
none
-
String
- Call ID.
// Retrieve the active application call and get the call ID
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let applicationCallId = applicationCall?.id()
Read-only property containing custom data. The value is defined as an object of key-value string pairs.
// Retrieve the active application call and get the custom data
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let customData = applicationCall?.customData()
Returns call duration in seconds calculated from the time call was established. Initially, duration is 0
.
none
-
Int
- Call duration
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Define a function to handle the hangup event
func onHangup(_ callHangupEvent: CallHangupEvent) {
// Get the duration of the active application call
let duration = applicationCall?.duration()
}
Returns time when the call started (but has not been established yet).
none
-
Date?
- Time when the call was initiated
// Retrieve the active application call and get the start time
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let startTime = applicationCall?.startTime()
Returns time when the call was established. Initially, establishTime is nil
.
none
-
Date?
- Time when the call was established
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Define a function to handle the call established event
func onEstablished(_ callEstablishedEvent: CallEstablishedEvent) {
// Get the establish time of the active application call
let establishTime = applicationCall?.establishTime()
}
Returns time when the call finished. Initially, endTime is nil
.
none
-
Date?
- Time when the call finished
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Define a function to handle the hangup event
func onHangup(_ callHangupEvent: CallHangupEvent) {
// Get the end time of the active application call
let endTime = applicationCall?.endTime()
}
Returns a unique Calls Configuration identifier associated with your Calls Configuration logical entity created through our Calls API.
none
-
String
- Represents theCalls Configuration ID
which is configured using theCalls Configuration API
.
// Retrieve the active application call and get the calls configuration id
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let callsConfigurationId = applicationCall?.callsConfigurationId()
Returns the list of participants currently connected with this application call.
none
-
[Participant]
- List of participants.
// Retrieve the active application call and get the list of participants
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let participants = applicationCall?.participants()
Returns a map of other participants' videos who currently have their video(s) enabled in the application call.
none
-
[String:RemoteVideo]
- Map that contains remote videos as values and participants' identifiers as keys.
// Retrieve the active application call and get the map of remote videos for every participant that has video(s) enabled
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let remoteVideos = applicationCall?.remoteVideos()
Toggles mute option.
-
shouldMute
:Bool
- Whether call should be muted after action or not.
N/A
// Mute the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.mute(true)
Returns information whether audio is muted or not.
none
-
Bool
- Is audio muted
// Retrieve the active application call and check if it's muted
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let muted = applicationCall?.muted()
Toggles whether sound should be played on the speakerphone or not. When call is started, it is disabled by default.
-
speakerphone
:Bool
-true
if the audio should be played on speakerphone, otherwisefalse
. -
completionHandler
:(Error?) -> Void
- Completion handler receiving error if setting speakerphone fails
N/A
// Enable speakerphone for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.speakerphone(true) { error in
// Handle any errors that may occur
if let error = error {
print("An error has occurred: \(e.description)")
}
}
Returns information whether speakerphone is enabled or not.
none
-
Bool
- Is speakerphone on
// Retrieve the active application call and check if speakerphone is enabled
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let speakerphoneEnabled = applicationCall?.speakerphone()
Simulates key-press by sending DTMF (Dual-Tone Multi-Frequency) entry.
-
dtmf
:String
- One of the allowed DTMF characters:- digits:
0
to9
- letters:
A
toD
- symbols:
*
and#
- digits:
N/A
-
DTMFError
- Error explaining why sending DTMF failed.
// Send DTMF tone "9" through the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.sendDTMF("9")
Toggles whether camera video should be enabled or not. For video calls it is enabled by default.
-
cameraVideo
:Bool
- Whether camera video should be enabled or not.
N/A
// Enable camera video for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.cameraVideo(true)
Note
When your application goes into background, due to iOS limitations of needing a UI to continue capturing video frames, the video capture will stop until the application is back in foreground. To mitigate this, when your application is in background, you should either have a floating video component in order to continue capturing the video or stop the video completely. Below is an example of detecting when your application is in background and turning off the video.
// Observe application background notifications
NotificationCenter.default.addObserver(self, selector:#selector(appMovedToBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
@objc func appMovedToBackground() throws {
if let applicationCall = self.getActiveApplicationCall(), applicationCall.hasCameraVideo() == true {
try applicationCall.cameraVideo(cameraVideo: false)
}
}
Returns information whether the current application call has camera video or not.
none
-
Bool
- Represents whether the application call has camera video.true
if it does, otherwisefalse
.
// Retrieve the active application call and check if camera video is enabled
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let hasCameraVideo = applicationCall?.hasCameraVideo()
Enables or disables sharing screen with the remote peer. Needs to be called after CallEstablishedEvent is received.
-
screenShare
:Bool
- Represents if screen sharing is turned on or off.
N/A
// Enable screen sharing for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.screenShare(true)
Returns true
if screen is being shared, otherwise else false
.
none
-
Bool
- Whether screen is being shared or not
// Retrieve the active application call and check if screen sharing is enabled
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let hasScreenShare = applicationCall?.hasScreenShare()
Returns local camera track.
none
-
VideoTrack?
- Video track representing local camera stream.nil
if there is no local camera video.
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Check if there is a local camera track
if let localCameraTrack = applicationCall?.localCameraTrack() {
// If there is a local view available, add the camera track renderer to it
if let localView = self.localView {
localCameraTrack.addRenderer(localView)
}
}
Returns local screen share track.
none
-
VideoTrack?
- Video track representing local screen share stream.nil
if there is no local screen share video.
// Retrieve the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
// Check if there is a local screen share track
if let localScreenShareTrack = applicationCall?.localScreenShareTrack() {
// If there is a local view available, add the screen share track renderer to it
if let localView = self.localView {
localScreenShareTrack.addRenderer(localView)
}
}
Change local camera orientation.
-
cameraOrientation
:CameraOrientation
- Camera orientation.
N/A
// Set the camera orientation to front for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.cameraOrientation(CameraOrientation.front)
Get current camera orientation.
none
-
CameraOrientation
- Camera orientation.
// Retrieve the active application call and get the camera orientation
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let cameraOrientation = applicationCall?.cameraOrientation()
Pauses incoming video media.
none
N/A
// Pause the incoming video for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.pauseIncomingVideo()
Resumes incoming video media.
none
N/A
// Resume the incoming video for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.resumeIncomingVideo()
Sets the audio quality mode to a given enum value.
-
mode
:AudioQualityMode
- Enum value that corresponds to the audio quality mode.
N/A
// Set the audio quality mode to low data for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.audioQualityMode(.lowData)
Returns an instance of the data channel used to send data.
none
-
DataChannel?
- Instance of the data channel.nil
if the data channel usage is not enabled.
// Retrieve the active application call and get the data channel
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
if let dataChannel = applicationCall?.dataChannel() {
// Send text using the data channel
}
This method sets the video filter to be used during the video call. Passing nil
will remove and release any already
existing video filter.
-
videoFilter
:VideoFilter?
- An instance ofVideoFilter
.
N/A
// Create a video filter
let videoFilter = createVideoFilter()
// Set the video filter for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.videoFilter(videoFilter)
This method returns the instance of VideoFilter
currently in use or nil
if no video filter is set.
none
-
VideoFilter?
- An instance ofVideoFilter
.
// Retrieve the active application call and get the video filter
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let videoFilter = applicationCall?.videoFilter()
This convenience method removes the video filter if it is present.
none
N/A
// Clear the video filter for the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.clearVideoFilter()
Hangs up call.
none
N/A
// Hang up the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
applicationCall?.hangup()
Returns the instance of the current RecordingState
.
none
-
RecordingState
- An instance ofRecordingState
representing the recording state of the currently active call/conference/dialog.
// Retrieve the recording state of the active application call
let applicationCall = getInfobipRTCInstance().getActiveApplicationCall()
let recordingState = applicationCall?.recordingState()