0

My notification came and everything works perfectly, but my application icon does not have a badge.

NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL)
                        .setSmallIcon(R.drawable.ic_notification)
                        .setContentTitle(prepareTitleMessage(remoteMessage.getNotification()))
                        .setContentText(remoteMessage.getNotification().getBody())
                        .setAutoCancel(true)
                        .setGroup(NOTIFICATION_CHANNEL)
                        .setContentIntent(pendingIntent)
                        .setDefaults(Notification.DEFAULT_SOUND)
                        .setVibrate(new long[]{1000, 1000})
                        .setStyle(new NotificationCompat.BigTextStyle()
                                .bigText(remoteMessage.getNotification().getBody())); 

NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL, NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
                        channel.setShowBadge(true);
                        manager.createNotificationChannel(channel);
                        manager.notify(requestCode, notificationBuilder.build());

0 Answers0