notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Required steps for closing a notification are incompatible with some platforms

Open hober opened this issue 8 years ago • 3 comments

On some platforms when the user dismisses an app's notification without activating it, the app is never woken up to be told that. No client-side app code is run in this case; the app is only woken up upon activation of the notification.

Could the wording of §2.8 Closing a notification be loosened to allow for such cases?

hober avatar Oct 11 '17 17:10 hober

+1, because platforms are all over the place.

On Mac OS X activation of the Close button can be observed by reading that activationType is set to none. That's a best effort method that gives the developer something.

I believe that the Action Center on Windows issues an event when the notification dismisses to the notification center, but not when it moves away from there.

On Android the event is not comprehensive too, given that there are reasons for notifications to close that won't cause the app to trigger, notably reboots or other apps clearing the list.

@hober, would adding a phrase like "if the platform is able to" satisfy this issue? The event has significant value, even if its functionality is best effort.

beverloo avatar Oct 11 '17 17:10 beverloo

@beverloo That's definitely an improvement, but I'm not sure "if the platform is able to" goes far enough. Sites need to code to this API under the assumption that their code will not run when a notification is closed, since that's the case on several platforms. I'd prefer the text say that UAs MAY run these steps, with perhaps a Note saying it's quite unlikely on some platforms.

hober avatar Oct 11 '17 18:10 hober

I'm fine with that, as it reflects reality. I'll send a PR tomorrow.

beverloo avatar Oct 11 '17 18:10 beverloo