Closed Bug 1775128 Opened 2 years ago Closed 2 years ago

Add `toast_notification` Messaging template for displaying (native) toast notifications

Categories

(Firefox :: Messaging System, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
104 Branch
Iteration:
104.2 - July 11 - July 22
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.

Depends on: 1775135
Depends on: 1775136
Assignee: nobody → nalexander
Iteration: --- → 103.2 - June 13 - June 24
Priority: -- → P1

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.

Depends on: 1771073
Blocks: 1775133
Iteration: 103.2 - June 13 - June 24 → 104.1 - June 27 - July 8
Whiteboard: [fidedi-notifications]
Iteration: 104.1 - June 27 - July 8 → 104.2 - July 11 - July 22
Flags: needinfo?(brennie)
Attachment #9282500 - Attachment description: Bug 1775128 - Add `toast_notification` message template for displaying (native) toast notifications. r?barret → Bug 1775128 - Add `toast_notification` message template for displaying (native) toast notifications. r?barret!,pdahiya!
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
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Blocks: 1787962
Blocks: 1790444
Blocks: 1804988
Blocks: 1838039
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: