Skip to content

Instantly share code, notes, and snippets.

@SubhrajyotiSen
Created December 5, 2021 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SubhrajyotiSen/b0b61af6f4550eb0aba78a6f754df209 to your computer and use it in GitHub Desktop.
Save SubhrajyotiSen/b0b61af6f4550eb0aba78a6f754df209 to your computer and use it in GitHub Desktop.
val manager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(
channelId,
channelName,
NotificationManager.IMPORTANCE_DEFAULT
)
manager.createNotificationChannel(channel)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment