Closed Bug 1533057 Opened 2 years ago Closed 2 years ago

GV API for Web Notifications (without Web Push)


(GeckoView :: General, enhancement, P1)



(firefox68 wontfix, firefox69 wontfix, firefox70 fixed)

Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- fixed


(Reporter: cpeterson, Assigned: awaseem)


(Regressed 1 open bug)


(Whiteboard: [geckoview:fenix:m7])


(1 file)

Web Push Notifications can work without Web Push (bug 1343678) while the browser is running, though the usefulness is limited.

Following up a bit here.

We recently released the WebPush Rust Component as part of Android-Components. The component lets you manage subscriptions and decrypt messages received through our Webpush server.

I also think it's important to note that there's two separate APIs at play here, there's WebPush (which delivers end to end encrypted content), and the Notification API (which displays a message to the user). While I know you can display Notifications without WebPush, I don't believe that you can call WebPush subscription from inside an app. You can call it from inside a web page, because it communicates with the underlying webpush service, but I don't believe it's a system level call. I believe the preferred mechanism on android is to call FCM (Firebase Cloud Messaging), which is very different and doesn't really provide the same functions. We use FCM for message delivery in the background, and it doesn't lend itself to public use.

Right, we're just referring to Notification API in this bug.

Adding [geckoview:fenix:m7] whiteboard tag because we should figure out our Web Notifications plans in Q2.

Whiteboard: [geckoview:fenix:p2] → [geckoview:fenix:m7]

Here's a proposed API. Initially I was thinking we'd have a WebNotifierController or similar class, but it's probably fine to just put the delegate on the GeckoRuntime directly. It does seem like this could get out of hand at some point, though.

class GeckoRuntime {
    void setWebNotificationDelegate(WebNotificationDelegate delegate);

interface WebNotificationDelegate {
   void onShowNotification(WebNotification notification);
   void onCloseNotification(WebNotification notification);

class WebNotification {
    public String title;
    public String text;
    /* other data members as required */

    public void click();
    public void dismiss();

Assignee: nobody → awaseem
Pushed by
Created Web Notifications API. r=geckoview-reviewers,agi,snorp
Pushed by
Created Web Notifications API. r=geckoview-reviewers,agi,snorp
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

firefox69=wontfix because we don't need to uplift the Web Notifications API to GV 69 Beta. It can ride the trains with GV 70.

Flags: needinfo?(awaseem)
You need to log in before you can comment on or make changes to this bug.