added some lines to get foreground notification (a little) less intrusive
This commit is contained in:
@@ -36,6 +36,7 @@ public class NotificationSupport {
|
|||||||
Channel.FOREGROUND,
|
Channel.FOREGROUND,
|
||||||
"Gotify foreground notification",
|
"Gotify foreground notification",
|
||||||
NotificationManager.IMPORTANCE_LOW);
|
NotificationManager.IMPORTANCE_LOW);
|
||||||
|
foreground.setShowBadge(false);
|
||||||
|
|
||||||
NotificationChannel messagesImportanceMin =
|
NotificationChannel messagesImportanceMin =
|
||||||
new NotificationChannel(
|
new NotificationChannel(
|
||||||
|
|||||||
@@ -168,6 +168,9 @@ public class WebSocketService extends Service {
|
|||||||
new NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND)
|
new NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND)
|
||||||
.setSmallIcon(R.drawable.ic_gotify)
|
.setSmallIcon(R.drawable.ic_gotify)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
|
.setPriority(NotificationCompat.PRIORITY_MIN)
|
||||||
|
.setShowWhen(false)
|
||||||
|
.setWhen(0)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(message)
|
.setContentText(message)
|
||||||
.setStyle(new NotificationCompat.BigTextStyle().bigText(message))
|
.setStyle(new NotificationCompat.BigTextStyle().bigText(message))
|
||||||
|
|||||||
Reference in New Issue
Block a user