logo
On this page

Event

ZegoUIKitPrebuiltCallInvitationServiceDelegate

Set Delegate
ZegoUIKitPrebuiltCallInvitationService.shared.delegate = self

requireConfig

  • function prototype:
func requireConfig(_ data: ZegoCallInvitationData) -> ZegoUIKitPrebuiltCallConfig
  • example:
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
            }
        }
    }
}

onIncomingCallDeclineButtonPressed

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

onIncomingCallAcceptButtonPressed

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

onOutgoingCallCancelButtonPressed

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

onIncomingCallReceived

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

onIncomingCallCanceled

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

onOutgoingCallAccepted

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

onOutgoingCallRejectedCauseBusy

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

onOutgoingCallDeclined

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

onIncomingCallTimeout

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

onOutgoingCallTimeout

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

onCallTimeUpdate

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

ZegoUIKitPrebuiltCallVCDelegate

Set Delegate
ZegoUIKitPrebuiltCallInvitationService.shared.callVCDelegate = self

getForegroundView

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

getMemberListItemView

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

getMemberListviewForHeaderInSection

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

getMemberListItemHeight

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

getMemberListHeaderHeight

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

onCallEnd

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

onToggleMicButtonClick

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

onToggleCameraButtonClick

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

onSwitchCameraButtonClick

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

onAudioOutputButtonClick

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

onOnlySelfInRoom

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

getChatViewItemView

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

getChatViewItemHeight

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

onCallTimeUpdate

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

onAudioOutputDeviceChanged

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

ZegoUIKitEventHandle

onIMRecvCustomCommand

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

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

Previous

API

Next

Config