Skip to content

Customize Call Module Notifications

Kristiyan Petrov edited this page Apr 26, 2022 · 14 revisions
  • Incoming calls can be displayed as notification or activities.
  • An incoming call notification can be clicked to display the call activity. It also has buttons to decline or answer (and open call activity) the call directly from the notification.
  • All call notifications (ongoing calls or incoming calls) may be customized inside the following method onCreateNotification(callInfo, callNotificationType, callNotificationStyle)
BandyerSDKConfiguration.Builder builder = new BandyerSDKConfiguration.Builder("mAppId",Environment.Production.INSTANCE,Region.Eu.INSTANCE);
builder.notificationListeners(listeners -> listeners.setCallNotificationListener(new CallNotificationListener() {
            @Override
            public void onIncomingCall(@NonNull IncomingCall incomingCall, 
                                                boolean isDnd, 
                                                boolean isScreenLocked) {
                if (!isDnd || isScreenLocked)
                    incomingCall.show(App.this);
                else {
                    incomingCall.asNotification().show(App.this);
                }
            }

            @Override
            public void onCreateNotification(@NonNull CallInfo callInfo,
                                             @NonNull CallNotificationType type,
                                             @NonNull CallNotificationStyle notificationStyle) {
                notificationStyle.setNotificationColor(Color.RED);
            }
}));
Clone this wiki locally