Closed mayeaux closed 3 years ago
@dan-peterson will take this one.
@mayeaux @tzarebczan As discussed, pivoted away from any integration with websocket notifications as a step one and opted to get everything set up for the real deal.
Feedback needed / appreciated on the current draft: https://github.com/lbryio/lbry-desktop/pull/7212
Thanks again @mayeaux for the nodetube reference code as well.
Regarding the copy and layout: Assuming that for now we won't be adding fine-grained control over desktop notifications, we could consider something like this:
We might want to handle handle the edge-case where a user has blocked notifications with something like this:
For improved UX we could also consider dimming / disabling the email settings, if the user has opted-out of email notifications entirely:
Regarding back-end implementation there are two things we haven't talked about yet that we should keep in mind:
1) Payload: We're going to want to try to keep this as simple and light weight as possible. Ideally the service worker doesn't need to do any extra work with the data to generate the notification.
Something like the following is ideal:
{
"title": "New Video on Odysee!",
"opts": {
"body": "Click here to check out the video.",
"data": {
"url" : "https://odysee.com/url/to/video"
}
}
}
2) Multiple browser subscriptions: Do we want to allow? Is there a max? and can we detect closed subscriptions server side?
Will get the discussion started on backend side for this. We'd probably want to put the channel name and title somewhere in the title/body too.
Since these will also work on mobile, "Desktop" notifications is a bad name. Browser Notifications?
Since these will also work on mobile, "Desktop" notifications is a bad name. Browser Notifications?
Hah. Yep good point. Browser Notifications sounds right to me unless we think of something better later.
Issue moved to OdyseeTeam/odysee-frontend #21 via ZenHub
This was originally in the PWA ticket but it's its own functionality and should probably warrant its own ticket.
Desired functionality: When a notification is received, a user receives either a push notification (mobile, only available natively on Android) or an in browser notification on desktop.
Requires registration of a serviceworker and a user opt-in, then should hook into the receiving of notifications from the backend