A much more detailed notification
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
android:value="2" />
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_channel_id"
|
||||
android:value="tasq_custom_sound_channel_2" />
|
||||
android:value="tasq_custom_sound_channel_3" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Application
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.media.AudioAttributes
|
||||
import android.util.Log
|
||||
import android.net.Uri
|
||||
|
||||
class App : Application() {
|
||||
@@ -13,7 +14,7 @@ class App : Application() {
|
||||
}
|
||||
|
||||
private fun createTasqChannel() {
|
||||
val channelId = "tasq_custom_sound_channel"
|
||||
val channelId = "tasq_custom_sound_channel_3"
|
||||
val name = "TasQ notifications"
|
||||
val importance = NotificationManager.IMPORTANCE_HIGH
|
||||
val channel = NotificationChannel(channelId, name, importance)
|
||||
@@ -25,8 +26,13 @@ class App : Application() {
|
||||
.build()
|
||||
|
||||
channel.setSound(soundUri, audioAttributes)
|
||||
// Ensure we do NOT bypass Do Not Disturb — let the system enforce silent/vibrate modes
|
||||
channel.setBypassDnd(false)
|
||||
// Allow vibration; system will respect device vibrate settings
|
||||
channel.enableVibration(true)
|
||||
|
||||
val nm = getSystemService(NotificationManager::class.java)
|
||||
nm?.createNotificationChannel(channel)
|
||||
Log.d("App", "Created notification channel: $channelId with sound=$soundUri")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user