0

in your code you dont have a **channel **which notification can work with us code

e.g.

private fun showNotification() {
    val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
    builder.setContentTitle("")
    builder.setContentText("")
    builder.setSmallIcon()

    val notification = builder.build()
    val manager = NotificationManagerCompat.from(this)

    manager.notify(1, notification)
}

companion object {
    const val NOTIFICATION_CHANNEL_ID = "my_channel_id_01"
}

in this moment you can just add const NOTIFICATION_CHANNEL_ID and your code does work

DASSDED
  • 26
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 18 '23 at 05:28

0 Answers0