提交 6bfd5f92 编写于 作者: C Caren Chang

Make notificationImportance an argument with default value when creating notification channel

上级 f3eb6306
......@@ -60,12 +60,13 @@ fun createNotification(context: Context, workRequestId: UUID, notificationTitle:
fun createNotificationChannel(
context: Context,
channelId: String,
name: String
name: String,
notificationImportance: Int = NotificationManager.IMPORTANCE_HIGH
): NotificationChannel {
val notificationManager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
return NotificationChannel(
channelId, name, NotificationManager.IMPORTANCE_LOW
channelId, name, notificationImportance
).also { channel ->
notificationManager.createNotificationChannel(channel)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册