-1

I'm developing an app which I have used local notification which is working fine till android version naught but its not showing notification in Android Oreo version. Its ask to create a "channel id " to get the local notification.

So, what's the way to create a channel id used in local notification.

1 Answers1

0

In Oreo version for notification you have to add this in your fcm class(when notification generate)

For more detail refer :https://developer.android.com/training/notify-user/channels

val channelId = "Default"
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                val channel = NotificationChannel(channelId, "Default channel", NotificationManager.IMPORTANCE_DEFAULT)
                manager.createNotificationChannel(channel)
            }
piet.t
  • 11,718
  • 21
  • 43
  • 52
Shweta Chauhan
  • 6,739
  • 6
  • 37
  • 57