Open ljzyljc opened 4 years ago
@Leo-Lin
Having the same issue where no notifications are showing up on the latest versions of Android (tested 2 devices myself) Whereas it still works on iOS (tested).
Is any effort being made to enable this to once again be compatible with android devices? It worked great but sucks for it to lose support.
same issue happen to me.. i found it's tiny bugs in shortbudger project i succeeded in android 9 (samsung) finally.
follow as below step
1.open BadgeIntentService.java in me.leolin.shortcutbadger.example
fill some text like this ---> setContentTitle("hello")
setContentTitle("") make no notification in badge count setContentTitle("some title") make good notification in badge count
@Override protected void onHandleIntent(Intent intent) { if (intent != null) { int badgeCount = intent.getIntExtra("badgeCount", 0);
mNotificationManager.cancel(notificationId);
notificationId++;
Notification.Builder builder = new Notification.Builder(getApplicationContext())
.setContentTitle("hello") <--------here!!!
.setContentText("")
.setSmallIcon(R.drawable.ic_launcher);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
setupNotificationChannel();
builder.setChannelId(NOTIFICATION_CHANNEL);
}
Notification notification = builder.build();
ShortcutBadger.applyNotification(getApplicationContext(), notification, badgeCount);
mNotificationManager.notify(notificationId, notification);
}
}
Hi,My debug Apk can show the number on The Samsung SM-G9600/DS ,but the release Apk can't show the number,and I test the debug and release APK on HUAWEI Device,they all works。I test other Samsung phone(all is android9),they all can't work, So How to slove the Problem?