logo
On this page

Event

Invitation Events

onIncomingCallDeclineButtonPressed

This callback will be triggered to callee when callee clicks the decline button in an incoming call.

Prototype
Example
onIncomingCallDeclineButtonPressed(navigation)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onIncomingCallDeclineButtonPressed: (navigation) => {
      //...
    },
  }
);
1
Copied!

onIncomingCallAcceptButtonPressed

This callback will be triggered to callee when callee clicks the accept button in an incoming call.

Prototype
Example
onIncomingCallAcceptButtonPressed(navigation)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onIncomingCallAcceptButtonPressed: (navigation) => {
      //...
    },
  }
);
1
Copied!

onOutgoingCallCancelButtonPressed

This callback will be triggered to caller when the caller cancels the call invitation by clicking the cancel button.

Prototype
Example
onOutgoingCallCancelButtonPressed(navigation, callID, invitees, type)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onOutgoingCallCancelButtonPressed: (navigation, callID, invitees, type) => {
      //...
    },
  }
);
1
Copied!

onIncomingCallReceived

This callback will be triggered to callee when callee receives a call.

Prototype
Example
onIncomingCallReceived(callID, inviter, type, invitees, customData)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onIncomingCallReceived: (callID, inviter, type, invitees, customData) => {
      //...
    },
  }
);
1
Copied!

onIncomingCallCanceled

This callback will be triggered to callee when the caller cancels the call invitation.

Prototype
Example
onIncomingCallCanceled(callID, inviter)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onIncomingCallCanceled: (callID, inviter) => {
      //...
    },
  }
);
1
Copied!

onIncomingCallTimeout

The callee will receive a notification through this callback when the callee doesn't respond to the call invitation after a timeout duration.

Prototype
Example
onIncomingCallTimeout(callID, inviter)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onIncomingCallTimeout: (callID, inviter) => {
      //...
    },
  }
);
1
Copied!

onOutgoingCallAccepted

The caller will receive a notification through this callback when the callee accepts the call invitation.

Prototype
Example
onOutgoingCallAccepted(callID, invitee)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onOutgoingCallAccepted: (callID, invitee) => {
      //...
    },
  }
);
1
Copied!

onOutgoingCallRejectedCauseBusy

The caller will receive a notification through this callback when the callee rejects the call invitation (the callee is busy).

Prototype
Example
onOutgoingCallRejectedCauseBusy(callID, invitee)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onOutgoingCallRejectedCauseBusy: (callID, invitee) => {
      //...
    },
  }
);
1
Copied!

onOutgoingCallDeclined

The caller will receive a notification through this callback when the callee declines the call invitation actively.

Prototype
Example
onOutgoingCallDeclined(callID, invitee)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onOutgoingCallDeclined: (callID, invitee) => {
      //...
    },
  }
);
1
Copied!

onOutgoingCallTimeout

The caller will receive a notification through this callback when the call invitation didn't get responses after a timeout duration.

Prototype
Example
onOutgoingCallTimeout(callID, invitees)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    onOutgoingCallTimeout: (callID, invitees) => {
      //...
    },
  }
);
1
Copied!

onCallEnd

User will receive this callback at the end of the call.

The possible values for reason may be as follows:

  • 0: The call ended due to a local hang-up
  • 1: The call ended when the remote user hung up, leaving only one local user in the call
  • 2: The call ended due to being kicked out
Prototype
Example
onCallEnd(callID, reason, duration)
1
Copied!
return ZegoUIKitPrebuiltCallService.init(
  Your_APPID,
  Your_APPSign,
  Your_UserID,
  Your_UserName,
  [ZIM, ZPNs],
  {
    requireConfig: (data) => {
      return {
        onCallEnd: (callID, reason, duration) => {
          //...
          props.navigation.navigate('HomeScreen');
        }
      }
    }
  }
);
1
Copied!