GV API for Web Notifications (without Web Push)
Categories
(GeckoView :: General, enhancement, P1)
Tracking
(firefox68 wontfix, firefox69 wontfix, firefox70 fixed)
People
(Reporter: cpeterson, Assigned: awaseem)
References
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/
Comment 1•5 years ago
|
||
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.
Reporter | ||
Comment 3•5 years ago
|
||
Adding [geckoview:fenix:m7] whiteboard tag because we should figure out our Web Notifications plans in Q2.
This gets routed through GeckoAppShell[0] currently, via AndroidAlerts.cpp[1]. We'll probably want to re-plumb that to use something else for GV.
[0] https://searchfox.org/mozilla-central/rev/c0ca77697c6868482f30af873ec8069f2c080a34/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java#522
[1] https://searchfox.org/mozilla-central/source/widget/android/AndroidAlerts.cpp
Comment 5•5 years ago
•
|
||
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 | ||
Comment 6•5 years ago
|
||
Reporter | ||
Comment 7•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Pushed by jwillcox@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6d823f106e69 Created Web Notifications API. r=geckoview-reviewers,agi,snorp
Comment 9•5 years ago
|
||
Backed out changeset 6d823f106e69 (bug 1533057) for Android mochitest failure in AndroidAlerts.cpp
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=261867472&repo=autoland&lineNumber=7519
Backout: https://hg.mozilla.org/integration/autoland/rev/691f28f0517fd094c983038165cd6fb6683bc852
Comment 10•5 years ago
|
||
Pushed by jwillcox@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d59ce318c46 Created Web Notifications API. r=geckoview-reviewers,agi,snorp
Comment 11•5 years ago
|
||
bugherder |
Reporter | ||
Comment 12•5 years ago
|
||
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.
Assignee | ||
Updated•5 years ago
|
Description
•