Last active
September 7, 2020 21:35
-
-
Save Ochornma/db40612e25c5c9ef9c9028c7135389cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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