Skip to content

Commit

Permalink
hide the notification by default
Browse files Browse the repository at this point in the history
  • Loading branch information
greenart7c3 committed Feb 16, 2024
1 parent 28fed9c commit a06e511
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ class WebSocketServerService : Service() {

private fun createNotification(): Notification {
val channelId = "WebSocketServerServiceChannel"
val channel = NotificationChannel(channelId, "WebSocket Server", NotificationManager.IMPORTANCE_DEFAULT)
val channel = NotificationChannel(
channelId,
"WebSocket Server",
NotificationManager.IMPORTANCE_UNSPECIFIED
)
channel.setSound(null, null)
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
Expand All @@ -96,7 +100,8 @@ class WebSocketServerService : Service() {
val notificationBuilder = NotificationCompat.Builder(this, "WebSocketServerServiceChannel")
.setContentTitle("Relay running at ws://localhost:${webSocketServer.port()}")
.setSmallIcon(R.mipmap.ic_launcher)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.addAction(R.drawable.ic_launcher_background, "Copy Address", piCopy)
.setContentIntent(resultPendingIntent)

Expand Down

0 comments on commit a06e511

Please sign in to comment.