ShortcutBadger icon indicating copy to clipboard operation
ShortcutBadger copied to clipboard

The Samsung(android 9) can't Work

Open ljzyljc opened this issue 5 years ago • 3 comments

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?

ljzyljc avatar Nov 28 '19 07:11 ljzyljc

@Leo-Lin

ljzyljc avatar Nov 28 '19 07:11 ljzyljc

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.

GaryOS5 avatar Mar 04 '20 13:03 GaryOS5

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 2. 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);
    }
}

ardourk avatar Mar 10 '20 12:03 ardourk