Merge pull request #33 from ialokim/foreground-notification

Some changes to foreground notification (channel)
This commit is contained in:
Jannis Mattheis
2018-12-22 16:42:40 +01:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ public class NotificationSupport {
Channel.FOREGROUND,
"Gotify foreground notification",
NotificationManager.IMPORTANCE_LOW);
foreground.setShowBadge(false);
NotificationChannel messagesImportanceMin =
new NotificationChannel(

View File

@@ -168,6 +168,9 @@ public class WebSocketService extends Service {
new NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND)
.setSmallIcon(R.drawable.ic_gotify)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setShowWhen(false)
.setWhen(0)
.setContentTitle(getString(R.string.app_name))
.setContentText(message)
.setStyle(new NotificationCompat.BigTextStyle().bigText(message))