Making a call

Make a call#

Call feature is essential for the modern day communication. Call sdk allows users to make a one to one audio/video call with the another sdk user.

Note: Permissions are handled in SDK.

Required permissions#

For audio call, the below permissions:

Record Permission

You can use the below method to check audio call permissions:

CallManager.isAudioCallPermissionsGranted()

For video call, we need below permissions:

Record Permission
Video Permission

You can use the below method to check video call permissions:

CallManager.isVideoCallPermissionsGranted()

Make a voice call#

Make voice call feature allows users to make a one to one audio call with the another sdk user. You can make a voice call using the below method.

CallManager.makeVoiceCall("TO_USERID") { isSuccess , message in
}
caution

If one to one call feature unavailable for your plan then it will throw 403 exception.

Make a video call#

Make video call feature allows users to make a one to one video call with the another sdk user. You can make a video call using the below method.

CallManager.makeVideoCall("TO_USERID") { isSuccess , message in
}
caution

If one to one call feature unavailable for your plan then it will throw 403 exception.

Make a group voice call#

Make group voice call feature allows users to make a voice call with multiple sdk users. You can make a group voice call using the below method.

ArgumentTypeDescription
USERID_LIST[String]Userid list of the callee's
GROUP_IDStringID of the group from which call is initiated
CallManager.makeGroupVoiceCall(USERID_LIST, groupID: GROUP_ID) { (isSuccess, message in
}
caution

If group call feature unavailable for your plan then it will throw 403 exception.

Make a group video call#

Make group video call feature allows users to make a video call with multiple sdk users. You can make a group video call using the below method.

CallManager.makeGroupVideoCall(USERID_LIST, GROUP_ID, (isSuccess, message) -> {
}
caution

If group call feature unavailable for your plan then it will throw 403 exception.

Add participants to the call#

After call is connected, you can able to add users to the ongoing call. sdk provides methods to invite users to the call, once they accepted the incoming call, they will join in the ongoing call.

ArgumentTypeDescription
USERID_LIST[String]Userid list of the callee's
CallManager.inviteUsersToOngoingCall(USERID_LIST) { isSuccess, message in
};
caution

If group call feature unavailable for your plan then it will throw 403 exception.

Receiving a incoming audio/video call#

Whenever you receive the audio/video call from the another sdk user, it should be reported to FlyCallSDK through NotificationCenter.

NotificationCenter.default.post(name: NSNotification.Name("CallPayloadReceived"), object: messageDict)

Through 'messageDict' pass the payload of the call. | Params | Type |Description | | -------------|---------|----------| |room_id | String | room id of the call| |call_status | String | status of the call| |call_mode | String | mode of the call| |call_type | String | type of the call| |Jid | String | user id of the call| |users | String | users of the call| |invite | String | invited users of the call| |group_id | String | room id of the call|

Disconnect the ongoing call#

Whenever you make the audio/video call to the another sdk user and you just want to disconnect the call before getting connected or If you want to just disconnect a connected call after the end of conversation, whenever user presses the disconnect button from your call UI , you need to call the below sdk method to disconnect the call and notify the caller.

CallManager.disconnectCall()