Call Features

Mute audio in call#

Whenever you are in the audio/video call, you can able to mute the mic so that receiver don't hear your voice or surrounding noise. In order the use the mute faeture you can utilise the call sdk method below:

ArgumentTypeDescription
MUTE_AUDIObooleanPass true, if you want to disable audio else pass false
CallManager.muteAudio(MUTE_AUDIO);

Mute video in call#

Whenever you are in the video call, you can able to turn off the camera so that receiver don't see your video. In order the use the video mute faeture you can utilise the call sdk method below:

ArgumentTypeDescription
MUTE_VIDEObooleanPass true,if you want to disable audio else pass false
CallManager.muteVideo(MUTE_VIDEO);

Check mute status of user in call#

At any time in call, you can able to check the audio/video mute status of the end user in call.

To check the audio muted status, call the below method:

ArgumentTypeDescription
END_USERIDStringUserId of the end call user
CallManager.isRemoteAudioMuted(END_USERID);

To check the video muted status, call the below method:

ArgumentTypeDescription
END_USERIDStringUserId of the end call user
CallManager.isRemoteVideoMuted(END_USERID);

Audio device types#

Call SDK provides the audio devices as an enum class OutputType, using which audio routing can be manipulated.

Device TypeDescription
OutputType.receiverDevice receiver
OutputType.speakerDevice Speaker
OutputType.headsetWired Headset
OutputType.bluetoothWireless Bluetooth
warning

A valid audio mp3 file with namefly_call_ringtone.mp3 should be placed in the root of the project. This file will be used to play the ringing tone while making a call.

Listen to Audio Device Changes#

To observe the changes in audio routing confirm to the protocol AudioManagerDelegate.

AudioManager.shared().audioManagerDelegate = self
func audioRoutedTo(DEVICE_NAME, AUDIO_DEVICE_TYPE) {}
ArgumentTypeDescription
DEVICE_NAMEStringName of the device in which the audio is currently routed to
AUDIO_DEVICE_TYPEOutputTypeAudio device type

Route audio via another device#

To route audio to another output device, call the below method and pass the device of your choice.

AudioManager.shared().routeAudioTo(AUDIO_DEVICE_TYPE, FORCE)
ArgumentTypeDescription
AUDIO_DEVICE_TYPEOutputTypeAudio device type
FORCEBoolif true routed to the audio device

Note : FORCE only has effect while audio device is set to speaker else it has no valid use case.

Auto route audio#

To route audio to available audio device call the below method

AudioManager.shared().routeToAvailableDevice(PREFERRED_AUDIO_DEVICE)
ArgumentTypeDescription
PREFERRED_AUDIO_DEVICEOutputTypeAudio device type

Note : If the passed PREFERRED_AUDIO_DEVICE isn't available the SDK will automatically route the audio to the appropriate audio device.

Get the currently selected#

By calling the below method will trigger the delegate AudioManagerDelegate through which we can detect the current audio device through which audio is routed to.

AudioManager.shared().getCurrentAudioInput()

Note: whenever you are connected to bluetooth headset while using sdk call, if the gsm call arrives and if you attends it then gsm call will take priority for the bluetooth headset.so, even if you disconnect the gsm call, bluetooth headset will not connect back to the sdk call.

Switching between camera in video call#

Whenever you are in video call, you can able to switch between camera's by using the below method.

CallManager.switchCamera()

switch audio call to video call#

Whenever you are in one to one audio call, you can able to switch to video call by using the below method.

CallManager.requestVideoCallSwitch()

Handling audio call to video call switch requests#

In your call activity, which you have given to the sdk using the CallManager.setCallActivityClass()

you need to check the below boolean flag in onCreate() as well as in onNewIntent() lifecycle callbacks.

CallManager.isCallConversionRequestAvailable();

If the above method returns true, you may need to show call switch requesting dialog with ACCEPT and REJECT buttons.

if the user accepts call switch then you need to call the below method to notify the call switch requested user.

CallManager.acceptVideoCallSwitchRequest();

If the user rejects call switch then you need to call the below method to notify the call switch requested user.

CallManager.declineVideoCallSwitchRequest();

Getting call logs from the sdk#

Call sdk keeps a local db for storing call logs which inlcudes all types of call logs with required information for the each and every call log. you can able to retrieve the call logs by using the below sdk method.

CallLogManager.getCallLogs(pageNumber: 1) { isSuccess, error, data in
if isSuccess {
var flyData = data
let successMessage = flyData.getMessage() as? String
let callLogList = flyData.getData() as? [CallLog]
}
}

Note : To get a call logs of respective page, pass the page number pageNumber parameter.

Getting missed call count#

Call sdk keeps a local db for storing missed call logs with required information for the each and every call log. you can able to retrieve the missed call count by using the below sdk method.

CallLogManager.getMissedCallCount();

Note : To get instant unread missed call count use FlyDefaults.unreadMissedCallCount.

Delete call logs#

Call sdk keeps a local db for storing call logs which inlcudes all types of call logs with required information for the each and every call log. you can able to delete single or all call log by using the below sdk method.

ChatManager.deleteCallLog(isClearAll: Bool, callLogIds: [String]) { isSuccess, error, data in
if isSuccess {
var flyData = data
let successMessage = flyData.getMessage() as? String
}
}
ArgumentTypeDescription
IS_CLEAR_ALLBoolPass true for clear all logs else false
CALL_LOG_ID[String]Ids of the call log

Note : To delete a single call log, pass the id of the call log in callLogId parameter, to delete all call log pass latest call log Id.

Sync all call logs#

Call sdk keeps a local db for storing call logs which inlcudes all types of call logs with required information for the each and every call log. you can able to Sync all call log to Api by using the below sdk method.

CallLogManager.syncCallLogs { isSuccess, error, data in
if isSuccess {
var flyData = data
let successMessage = flyData.getMessage() as? String
let callLogList = flyData.getData() as? [CallLog]
}
}