Android categorize notification under Silent notifications

Viewed 209

I'm running a persistent task in the background and need to show a notification that my app is running a service (From Android Oreo & above)

However, I would like to see the notification under the Silent notifications category rather than Alerting notifications as the notification seems intrusive to the user. I've seen various applications do this and was wondering how I could achieve the same.

Output I would like enter image description here

I've tried meddling with the setPriority and .setCategory methods but still get the same result.

NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
        Notification notification = notificationBuilder.setOngoing(true)
                .setContentTitle("App is running in background")
                .setPriority(NotificationManager.IMPORTANCE_LOW)
                .setCategory(Notification.CATEGORY_SYSTEM)
                .build();

        startForeground(1, notification); //To start the service
0 Answers
Related