Implement optional separate app notification channels

This commit is contained in:
Niko Diamadis
2023-02-13 12:24:40 +01:00
parent 8bae62cc24
commit ddd902e17e
8 changed files with 238 additions and 37 deletions

View File

@@ -2,6 +2,7 @@ package com.github.gotify.init
import android.Manifest
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
@@ -41,8 +42,9 @@ internal class InitializationActivity : AppCompatActivity() {
ThemeHelper.setTheme(this, theme)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationSupport.createChannels(
this.getSystemService(NOTIFICATION_SERVICE) as NotificationManager
NotificationSupport.createForegroundChannel(
this,
(this.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager)
)
}
UncaughtExceptionHandler.registerCurrentThread()