Как понять, почему я могу изменить важность уведомления, но не могу создать баннер без увеличения значка приложения?
Я wi sh Я могу показать баннер в строке состояния,
заставить телефон вибрировать и включить звук, но не позволять счетчику приложения увеличиваться на +1 для определенного c уведомления.
Теперь я пробовал этот код, но не могу избежать значок. что я делаю не так?
private void showBannerOnly() {
String id = "channel";
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel mChannel = new NotificationChannel(id, "name", importance);
mChannel.setShowBadge(false);
if (manager != null) {
manager.createNotificationChannel(mChannel);
Intent intent = new Intent(service, Main.class);
intent.putExtra("app.push", push);
PendingIntent pending = PendingIntent.getActivity(
service.getApplicationContext(),
aggregation,
intent,
PendingIntent.FLAG_CANCEL_CURRENT);
manager.notify(
aggregation,
new NotificationCompat.Builder(
service,
Type.isMessage(push.getEnumType())
? service.getString(R.string.push_channel_messages_id)
: Type.isEvent(push.getEnumType())
? service.getString(R.string.push_channel_events_id)
: service.getString(R.string.push_channel_default_id))
.setCategory(category)
.setWhen(push.getWhen())
.setSmallIcon(R.mipmap.ic_launcher)
.setContentIntent(pending)
.setDefaults(NotificationCompat.DEFAULT_ALL)
.setPriority(NotificationCompat.PRIORITY_MAX)
.setVisibility(NotificationCompat.VISIBILITY_PRIVATE)
.setBadgeIconType(NotificationCompat.BADGE_ICON_LARGE)
.setStyle(style)
.setChannelId(id)
.setAutoCancel(true)
.build());
}
}