Karn / notify

Simplified notification construction and delivery for Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can you define notify id to update and cancel notify

GramWT opened this issue · comments

Hi @GramWT,

You can do the following:

// Build a notification up until the end
val notification = Notify.with(...)
  ...

// Then show the notion initially
val notificationid = notification.show()

// To mutate the request you can reuse the notification, even though the
// the method is deprecated (only to prevent shooting oneself in the foot)
// you can use it to perform a stable update.
notification.show(notificationId)

// To cancel a notification you can do the following
Notify.cancelNotification(this.context, notificationId)

I will be looking at a more stable way of doing this in the future since the current logic is tailored around the Stacked notifications.

Going to close this for now, but feel free to reopen if you have any other concerns.