Closed Bug 1533057 Opened 7 months ago Closed 28 days ago

GV API for Web Notifications (without Web Push)

Categories

(GeckoView :: General, enhancement, P1)

Unspecified
Android
enhancement

Tracking

(firefox68 wontfix, firefox69 wontfix, firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: cpeterson, Assigned: awaseem)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [geckoview:fenix:m7])

Attachments

(1 file)

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

https://developers.google.com/web/fundamentals/push-notifications/

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]
Blocks: 1561593

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
Status: NEW → ASSIGNED
Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6d823f106e69
Created Web Notifications API. r=geckoview-reviewers,agi,snorp
Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2d59ce318c46
Created Web Notifications API. r=geckoview-reviewers,agi,snorp
Status: ASSIGNED → RESOLVED
Closed: 28 days 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)
Regressions: 1542525
You need to log in before you can comment on or make changes to this bug.