Add `toast_notification` Messaging template for displaying (native) toast notifications
Categories
(Firefox :: Messaging System, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: nalexander, Assigned: nalexander)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: [fidedi-notifications])
Attachments
(2 files)
We would like Firefox to display Window native toast notifications when it has been updated in the background and some targeting criteria are met. I would like to do this by making select background tasks participate in the Firefox Messaging System and add toast notifications as a candidate Messaging "surface", sibling to the existing infobar and/or spotlight surfaces. This toast notification template is independent of its use in background tasks: it is sensible for Firefox to display (native) toast notifications in some circumstances.
Under the hood, I propose that the template schema roughly mirror the Web Notification API surface with:
title
(localized)body
(localized)iconURL
(must be URL for native notification support)imageURL
(ditto)requireInteraction
data
(probably a string)tag
(string)
In general, notifications (including native notifications) support callbacks when various actions are taken/buttons clicked/etc. Callbacks in any generality are going to be hard to support, so I propose some top-level type
equivalent that leaves some flexibility about what action engagement actually takes. That will let us handle "launch Firefox to this URL with some additional parameters", which is enough for my immediate use case.
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
I'm going to block this on Bug 1771073, since everything in the space will make more sense once that lands. Per :barret, plan is to land at beginning of 104 cycle.
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
NI to barret for https://phabricator.services.mozilla.com/D150073#inline-833793.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dead48c5b140 Pre: Add `RemoteL10n.formatLocalizableText` helper. r=barret,Mardak https://hg.mozilla.org/integration/autoland/rev/5558ed2f4df2 Add `toast_notification` message template for displaying (native) toast notifications. r=Mardak
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dead48c5b140
https://hg.mozilla.org/mozilla-central/rev/5558ed2f4df2
Description
•