I recently updated my app to API 26, and notifications are no longer working, without even changing the code.
val notification = NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle("Title")
.setContentText("Text")
.build()
(getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(1, notification)
Why isn't it working? Was there some change to the API that I'm not aware of?
From the documentation:
(emphasis added)
You do not seem to be associating this
Notification
with a channel.Here i post some quick solution