Missed call notification and dial-back
Notification and dial-back features are only supported on Android.
By default, Call Kit supports users to get the notifications of a missed call and call back automatically by click the notification. However, if users do not want to use the the features, Call Kit also provides disabling methods.
If you need the dial-back feature for missed calls (when enableDialBack is true
), the invitation feature will no longer be compatible with versions before v4.12.0. This means that invitations sent by users of versions before v4.12.0 will not be received by users of version 4.12.0 or later, and vice versa.
Therefore, when releasing the app, it is important to implement a force upgrade for users to avoid issues with call reception.
However, if this feature is not enabled (when enableDialBack is false
), the above problem will not bother you.
Effects
-
Group chat, online/offline missed-call and dial-back
-
One-to-one chat, online missed-call and dial-back
Parameters and configurations
The following parameters and configurations are used for the notification and the dial-back.
-
ZegoCallInvitationConfig
-
bool
endCallWhenInitiatorLeave
:Whether the entire call should end when the initiator leaves the call, causing other participants can not join the call.
The default value is
false
meaning that the call can continue even after the initiator leaves.
-
-
ZegoCallInvitationMissedCallConfig
-
bool
enabled
Used to enable the pop-up notification for missed calls.
The default value is
true
. -
bool
enableDialBack
Whether to allow dial-back the missed when click notification
Default value is
true
.Please note that if allowed, it will be incompatible with versions before v4.12.0, meaning that mutual invitations can not be made between the old and new versions of zego_uikit_prebuilt_call.
-
String?
resourceID
The resource ID for notification. It is the same as the one configured on the ZEGOCLOUD Console
-
String? Function()?
notificationTitle
The title for the notification.
-
String? Function()?
notificationMessage
The message for the notification.
-
int
timeoutSeconds
The timeout duration in seconds for the dial-back invitation.
-
How to disable missed call pop-up notifications
When you initialize the call invitation service, set the ZegoCallInvitationMissedCallConfig > enabled
to be false
.
ZegoUIKitPrebuiltCallInvitationService().init(
...
config: ZegoCallInvitationConfig(
endCallWhenInitiatorLeave: true,
missedCall: ZegoCallInvitationMissedCallConfig(
enabled: false,
),
),
);
How to disable missed call dial-back
When you initialize the call invitation service, set the ZegoCallInvitationMissedCallConfig > enableDialBack
to be false
.
ZegoUIKitPrebuiltCallInvitationService().init(
...
config: ZegoCallInvitationConfig(
endCallWhenInitiatorLeave: true,
missedCall: ZegoCallInvitationMissedCallConfig(
enableDialBack: false,
),
),
);
Events
Listen to the following event callbacks related to the missed call notification and dial-back:
onIncomingCallTimeout
: The callee will receive a notification through this callback when the callee doesn't respond to the call invitation after a timeout duration.onIncomingMissedCallClicked
: This callback will be triggered to callee when callee click the missed call notification.onIncomingMissedCallDialBackFailed
: This callback will be triggered when the dial-back of missed call is failed.
Please refer to the API reference for complete parameters.
ZegoUIKitPrebuiltCallInvitationService().init(
...
invitationEvents: ZegoUIKitPrebuiltCallInvitationEvents(
onIncomingCallTimeout: (
String callID,
ZegoCallUser caller
) {
/// Add your custom logic here.
},
onIncomingMissedCallClicked: (
String callID,
ZegoCallUser caller,
ZegoCallInvitationType callType,
List<ZegoCallUser> callees,
String customData,
/// The default action is to dial back the missed call
Future<void> Function() defaultAction,
) async {
/// Add your custom logic here.
await defaultAction.call();
},
onIncomingMissedCallDialBackFailed: () {
/// Add your custom logic here.
},
...
),
...
);