Skip to content

Customize Chat Module Notifications

Kristiyan Petrov edited this page Apr 26, 2022 · 9 revisions
  • Incoming chat messages can be displayed as notification or activities.
  • A chat notification once clicked will open the chat activity.
  • All chat notifications may be customized inside the following method: onCreateNotification(chatInfo, chatNotificationStyle)
BandyerSDKConfiguration.Builder builder = new BandyerSDKConfiguration.Builder("mAppId",Environment.Production.INSTANCE,Region.Eu.INSTANCE);
builder.notificationListeners(listeners -> listeners.setChatNotificationListener(new ChatNotificationListener() {
            @Override
            public void onIncomingChat(@NonNull IncomingChat chat,
                                                boolean isDnd,
                                                boolean isScreenLocked) {                
                chat.asNotification().show(App.this);
            }

            @Override
            public void onCreateNotification(@NonNull ChatInfo chatInfo,
                                             @NonNull ChatNotificationStyle notificationStyle){
                notificationStyle.setNotificationColor(Color.RED);
            }
}));
Clone this wiki locally