Skip to content

Instantly share code, notes, and snippets.

@hitherejoe
Created Jun 12, 2017
Embed
What would you like to do?
val notificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val id = "some_channel_id"
val name = getString(R.string.channel_name)
val description = getString(R.string.channel_description)
val importance = NotificationManager.IMPORTANCE_LOW
val channel = NotificationChannel(id, name, importance)
channel.description = description
channel.setShowBadge(true)
notificationManager.createNotificationChannel(channel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment