Skip to content

Instantly share code, notes, and snippets.

@Ochornma
Last active September 7, 2020 21:35
Show Gist options
  • Select an option

  • Save Ochornma/db40612e25c5c9ef9c9028c7135389cd to your computer and use it in GitHub Desktop.

Select an option

Save Ochornma/db40612e25c5c9ef9c9028c7135389cd to your computer and use it in GitHub Desktop.
class App: Application() {
lateinit var appContainer: AppContainer
var ID = "My app"
override fun onCreate() {
super.onCreate()
appContainer = AppContainer(this)
createNotificationChannels()
}
private fun createNotificationChannels() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(ID, "My app", NotificationManager.IMPORTANCE_HIGH )
channel.description = getString(R.string.app_describe)
val manager = getSystemService(NotificationManager::class.java)
manager.createNotificationChannel(channel)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment