logo
On this page

Event

ZegoUIKitPrebuiltCallInvitationServiceDelegate

Set Delegate
ZegoUIKitPrebuiltCallInvitationService.shared.delegate = self
1
Copied!

requireConfig

  • function prototype:
Untitled
func requireConfig(_ data: ZegoCallInvitationData) -> ZegoUIKitPrebuiltCallConfig
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func requireConfig(_ data: ZegoCallInvitationData) -> ZegoUIKitPrebuiltCallConfig {
        if data.type == .voiceCall {
            if data.invitees?.count ?? 0 > 1 {
                let config = ZegoUIKitPrebuiltCallConfig.groupVoiceCall()
                return config
            } else {
                let config = ZegoUIKitPrebuiltCallConfig.oneOnOneVoiceCall()
                return config
            }
        } else {
            if data.invitees?.count ?? 0 > 1 {
                let config = ZegoUIKitPrebuiltCallConfig.groupVideoCall()
                return config
            } else {
                let config = ZegoUIKitPrebuiltCallConfig.oneOnOneVideoCall()
                return config
            }
        }
    }
}
1
Copied!

onIncomingCallDeclineButtonPressed

  • function prototype:
Untitled
func onIncomingCallDeclineButtonPressed()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onIncomingCallDeclineButtonPressed() {
    //...
  }
}
1
Copied!

onIncomingCallAcceptButtonPressed

  • function prototype:
Untitled
func onIncomingCallAcceptButtonPressed()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onIncomingCallAcceptButtonPressed() {
    //...
  }
}
1
Copied!

onOutgoingCallCancelButtonPressed

  • function prototype:
Untitled
func onOutgoingCallCancelButtonPressed()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onOutgoingCallCancelButtonPressed() {
    //...
  }
}
1
Copied!

onIncomingCallReceived

  • function prototype:
Untitled
func onIncomingCallReceived(_ callID: String, caller: ZegoCallUser, callType: ZegoCallType, callees: [ZegoCallUser]?)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onIncomingCallReceived(_ callID: String, caller: ZegoCallUser, callType: ZegoCallType, callees: [ZegoCallUser]?) {
    //...
  }
}
1
Copied!

onIncomingCallCanceled

  • function prototype:
Untitled
func onIncomingCallCanceled(_ callID: String, caller: ZegoCallUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onIncomingCallCanceled(_ callID: String, caller: ZegoCallUser) {
    //...
  }
}
1
Copied!

onOutgoingCallAccepted

  • function prototype:
Untitled
func onOutgoingCallAccepted(_ callID: String, callee: ZegoCallUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onOutgoingCallAccepted(_ callID: String, callee: ZegoCallUser) {
    //...
  }
}
1
Copied!

onOutgoingCallRejectedCauseBusy

  • function prototype:
Untitled
func onOutgoingCallRejectedCauseBusy(_ callID: String, callee: ZegoCallUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onOutgoingCallRejectedCauseBusy(_ callID: String, callee: ZegoCallUser) {
    //...
  }
}
1
Copied!

onOutgoingCallDeclined

  • function prototype:
Untitled
func onOutgoingCallDeclined(_ callID: String, callee: ZegoCallUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onOutgoingCallDeclined(_ callID: String, callee: ZegoCallUser) {
    //...
  }
}
1
Copied!

onIncomingCallTimeout

  • function prototype:
Untitled
func onIncomingCallTimeout(_ callID: String,  caller: ZegoCallUser)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onIncomingCallTimeout(_ callID: String,  caller: ZegoCallUser) {
    //...
  }
}
1
Copied!

onOutgoingCallTimeout

  • function prototype:
Untitled
func onOutgoingCallTimeout(_ callID: String, callees: [ZegoCallUser])
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onOutgoingCallTimeout(_ callID: String, callees: [ZegoCallUser]) {
    //...
  }
}
1
Copied!

onCallTimeUpdate

  • function prototype:
Untitled
func onCallTimeUpdate(_ duration: Int)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallInvitationServiceDelegate {
  func onCallTimeUpdate(_ duration: Int) {
    //...
  }
}
1
Copied!

ZegoUIKitPrebuiltCallVCDelegate

Set Delegate
ZegoUIKitPrebuiltCallInvitationService.shared.callVCDelegate = self
1
Copied!

getForegroundView

  • function prototype:
Untitled
func getForegroundView(_ userInfo: ZegoUIKitUser?) -> ZegoBaseAudioVideoForegroundView?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getForegroundView(_ userInfo: ZegoUIKitUser?) -> ZegoBaseAudioVideoForegroundView? {
    //...
  }
}
1
Copied!

getMemberListItemView

  • function prototype:
Untitled
func getMemberListItemView(_ tableView: UITableView, indexPath: IndexPath, userInfo: ZegoUIKitUser) -> UITableViewCell?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getMemberListItemView(_ tableView: UITableView, indexPath: IndexPath, userInfo: ZegoUIKitUser) -> UITableViewCell? {
    //...
  }
}
1
Copied!

getMemberListviewForHeaderInSection

  • function prototype:
Untitled
func getMemberListviewForHeaderInSection(_ tableView: UITableView, section: Int) -> UIView?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getMemberListviewForHeaderInSection(_ tableView: UITableView, section: Int) -> UIView? {
    //...
  }
}
1
Copied!

getMemberListItemHeight

  • function prototype:
Untitled
func getMemberListItemHeight(_ userInfo: ZegoUIKitUser) -> CGFloat
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getMemberListItemHeight(_ userInfo: ZegoUIKitUser) -> CGFloat {
    //...
  }
}
1
Copied!

getMemberListHeaderHeight

  • function prototype:
Untitled
func getMemberListHeaderHeight(_ tableView: UITableView, section: Int) -> CGFloat
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getMemberListHeaderHeight(_ tableView: UITableView, section: Int) -> CGFloat {
    //...
  }
}
1
Copied!

onCallEnd

  • function prototype:
Untitled
func onCallEnd(_ endEvent: ZegoCallEndEvent)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
    func onCallEnd(_ endEvent: ZegoCallEndEvent) {
        print("reason: \(String(describing: endEvent.reason)) kickerUserID: \(endEvent.kickerUserID)")
    }
}
1
Copied!

onToggleMicButtonClick

  • function prototype:
Untitled
func onToggleMicButtonClick(_ isOn: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func onToggleMicButtonClick(_ isOn: Bool) {
    //...
  }
}
1
Copied!

onToggleCameraButtonClick

  • function prototype:
Untitled
func onToggleCameraButtonClick(_ isOn: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func onToggleCameraButtonClick(_ isOn: Bool) {
    //...
  }
}
1
Copied!

onSwitchCameraButtonClick

  • function prototype:
Untitled
func onSwitchCameraButtonClick(_ isFrontFacing: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func onSwitchCameraButtonClick(_ isFrontFacing: Bool) {
    //...
  }
}
1
Copied!

onAudioOutputButtonClick

  • function prototype:
Untitled
func onAudioOutputButtonClick(_ isSpeaker: Bool)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func onAudioOutputButtonClick(_ isSpeaker: Bool) {
    //...
  }
}
1
Copied!

onOnlySelfInRoom

  • function prototype:
Untitled
func onOnlySelfInRoom()
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func onOnlySelfInRoom() {
    //...
  }
}
1
Copied!

getChatViewItemView

  • function prototype:
Untitled
func getChatViewItemView(_ tableView: UITableView, indexPath: IndexPath, message: ZegoInRoomMessage) -> UITableViewCell?
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getChatViewItemView(_ tableView: UITableView, indexPath: IndexPath, message: ZegoInRoomMessage) -> UITableViewCell? {
    //...
  }
}
1
Copied!

getChatViewItemHeight

  • function prototype:
Untitled
func getChatViewItemHeight(_ tableView: UITableView, heightForRowAt indexPath: IndexPath, message: ZegoInRoomMessage) -> CGFloat
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func getChatViewItemHeight(_ tableView: UITableView, heightForRowAt indexPath: IndexPath, message: ZegoInRoomMessage) -> CGFloat {
    //...
  }
}
1
Copied!

onCallTimeUpdate

  • function prototype:
Untitled
func onCallTimeUpdate(_ duration: Int)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
  func onCallTimeUpdate(_ duration: Int) {
    //...
  }
}
1
Copied!

onAudioOutputDeviceChanged

  • function prototype:
Untitled
func onAudioOutputDeviceChanged(_ audioOutput: ZegoUIKitAudioOutputDevice)
1
Copied!
  • example:
Untitled
extension ViewController: ZegoUIKitPrebuiltCallVCDelegate {
   func onAudioOutputDeviceChanged(_ audioOutput: ZegoUIKitAudioOutputDevice) {
       // ...
   }
}
1
Copied!

ZegoUIKitEventHandle

onIMRecvCustomCommand

This callback is triggered when a user receives a custom command sent by another user in the room.

  • function prototype:
    Untitled
    func onIMRecvCustomCommand(_ fromUser: ZegoUIKitUser, command: String)
    
    1
    Copied!
  • example:
    Untitled
    extension ViewController: ZegoUIKitEventHandle {
         func onIMRecvCustomCommand(_ fromUser: ZegoUIKitUser, command: String) {
           // ...
        }
    }
    
    1
    Copied!