Karn / notify

Simplified notification construction and delivery for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timeout has no affect.

NLLAPPS opened this issue · comments

I am not sure it it is my fault. I don;t think it is but, Timeout option seems to have no affect.
Here is my sample notification that does not timeout after any seconds

 `fun test(context: Context) {
  val title= "Test title"
    val commonNotificationAlertingPayload = commonNotificationChannelAlertPayload(context)
    val addIntent = .....
    val pendingAddIntent = PendingIntent.getBroadcast(context, 0, addIntent, PendingIntent.FLAG_UPDATE_CURRENT)

    Notify.with(context)
            .meta {
                timeout = 60 * 1000L // Auto dismiss after 60 seconds
                cancelOnClick = true
                clickIntent = pendingAddIntent
            }
            .alerting(commonNotificationAlertingPayload.channelKey) {
                lockScreenVisibility = commonNotificationAlertingPayload.lockScreenVisibility
                channelName = commonNotificationAlertingPayload.channelName
                channelImportance = commonNotificationAlertingPayload.channelImportance
            }
            .header {
                icon = R.drawable.ic_question_black_24dp
                color = ContextCompat.getColor(context, R.color.color_primary)
                showTimestamp = true
            }
            .content {
                title = title
                text ="Test"
            }
            .show(title.hashCode())

}`

It seems to work on real device but not on Emulator. Weird.