I'm working on an android application, I need to show an account in the main icon of the application, in android oreo works the class Notification Badge, but in android 9 in a google pixel does not show it, and in Sony Xperia XZ2 with android Pie does not work either it does not show the unread notifications icon.
I have tried with third-party libraries like ShortcutBadger and the like, but they are not compatible with new android versions
NotificationChannel fyfChannel = new NotificationChannel(FYF_CHANNEL__ID, FYF_CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH);
fyfChannel.enableLights(true);
fyfChannel.enableVibration(true);
fyfChannel.setLightColor(Color.GREEN);
fyfChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
fyfChannel.setShowBadge(true);
AudioAttributes audioAttributes = new AudioAttributes.Builder().setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION).setUsage(AudioAttributes.USAGE_NOTIFICATION).build();
fyfChannel.setSound( Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.audio1), audioAttributes);
getManager().createNotificationChannel(fyfChannel);