Skip to main content

set_close_handler

Function set_close_handler 

pub fn set_close_handler(
    prefix: &str,
    handler: impl Fn(&str, CloseReason) + Send + Sync + 'static,
)
Expand description

Call handler with the tag and reason of every notification whose tag starts with prefix that the platform closes, on whatever thread reports it. Replaces an earlier handler for prefix; where prefixes nest, the longest one wins.

Only some platforms report this (Feature::Close), and only for notifications they closed themselves: a notification the app withdrew is the app’s own doing and is not reported. A dismissal (CloseReason::Dismissed) is the person’s answer; CloseReason::Expired and CloseReason::Closed say nothing about them.