Can I capture a 'Dismiss Notification' click?

Jump to solution
griffindodd
Community Novice

Is there a hook in Canvas that will tell me if my notification from my plugin was dismissed (by clicking the small 'x')?

0 Likes
1 Solution
robotcars
Community Champion

Hi  @griffindodd 

Maybe?...

Is your plugin a true LTI, loaded in an iframe, a custom Theme or User Script, or a backend script you use to trigger something in Canvas?

Where is the notification, is it a Conversations API, Announcements, or something else?

You can use Canvas Themes and custom JavaScript to capture events in the DOM, but that won't work from within an LTI.

If you use custom JavaScript, you can capture the event, but you have no way to communicate that back. One solution would be to use Custom Data - Users API in that JavaScript, and then read it later, and delete it after reading.

Can you offer some more details?

View solution in original post