CallInitialization

For call UI you need to do following setup, so the call feature can work properly

Initiate video and audio call from user defined activity and fragment#

CallPermissionManager is the starting point for launching audio and video calls in your application. By implementing the code below, you will initiate audio and video calls.

Activity Implementation#
class MainActivity : AppCompatActivity() {
# Declaring CallPermissionManager
private lateinit var call_Permission: CallPermissionManager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
# Initilization CallPermissionManager
call_Permission = CallPermissionManager(this)
button.setOnClickListener {
# To make call from activity
call_Permission.makeAudioVideoCalls(JID_LIST,CallType)
}
}
}
Fragment Implementation#
class MainActivity : AppCompatActivity(),CallOnClickListener {
private lateinit var call_Permission: CallPermissionManager
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
call_Permission = CallPermissionManager(this)
}
override fun onMakeAudioVideoCall(jidList: ArrayList<String>, callType:String) {
call_Permission.makeAudioVideoCalls(JID_LIST,CallType)
}
}
class MainFragment : Fragment() {
private lateinit var callBackListener: CallOnClickListener
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (activity is CallOnClickListener) callBackListener = (activity as CallOnClickListener)
# To make call from fragment
button.setOnClickListener{
callBackListener.onMakeAudioVideoCall("JID_LIST","CallType")
}
}
}
ArgumentReturn typeDescription
JID_LISTarraylistof(String)JID list of the callee's
CallType (CallType.AUDIO_CALL or CallType.VIDEO_CALL)StringWhether its Audio call or Video Call