Discourse Push Notifications for Desktop

Everything is awesome. I have one little concern that we shouldn’t receive continuous a push notification for already read messages.

1 Like

Trying to get this going. The first time I enabled in my admin profile, I believe I saw a 403 error. Subsequent times I can enable OK (at least no error), but when the page is reloaded the option has been disabled again. Am I missing something? Thanks!

Isn’t this enabled by default on the latest Discourse version?
Or should we install this plugin separately even if we are on the latest version of Discourse?

1 Like

I’ve enabled push notifications on my discourse forum (as an admin).
And I’ve accepted the chrome prompt in Android mobile to receive my forum notifs.

Yet, neither I receive any live/push notifs while I’m sitting on pc/browsing thru Firefox (doesn’t matter if my forum is open in some tab or not).
Nor do I receive any type of notif in my android mobile. Am I missing something?

every forum user browsing my forum on Android mobile Chrome browser gets a prompt to enable push notifications, which he does, and accepts the prompt, yet no notif.

I’ve enabled ‘Push Notifs Plugin’ as shown below.

But I still get push/live notifs on desktop ONLY when the forum is open in some/one tab. If I close my forum from all tabs of my browser/firefox latest version, no notif would be received.

And, as discussed in previous post, on mobile no notif is received ever (even though Android Chrome is correctly configured to send/receive push notifs for this/my forum).

1 Like

Yes, this is the same behavior I’ve long observed. No push notifications unless the forum is open on a tab.

1 Like

@BobbyZopfan @L30110 after you toggle the checkmark for prefering push notification, you need to re-enable notifications.


I’ve already tried doing that. Enabling, disabling, then enabling again.
But on PC, Notifs arrive only if forum is open in some tab. Whether Notifs plugin installed or not. (I highly doubt if the plugin is needed at all, after the Notifs is part of core now)

On mobile, notifs arrive only on Nokia mobile.

It for sure seems the checkbox isn’t saving (even when I hit save). Doesn’t matter if notifications were enabled or disabled. Checking the box, saving and refreshing shows it unchecked. If notifications are disabled and the box is checked, the enable notifications button can be clicked but nothing happens. The button stays the same and I don’t get a notification.Just installed the plugin a few minutes ago. Sure seems like this plugin is broken @featheredtoast

EDIT: Seems that the LocalStorage key discourse_push_notifications_prefer_push is getting wiped out on every refresh. Possibly related.

EDIT 2: My amateur Discourse development skills have led me to believe the custom user field isn’t being set with the users preference choice. LocalStorage key is being reset to "" because it doesn’t match what custom field has stored. Looks like this may have been introduced at 775a4c81b9dcb424243af64a61b0a7a6c81606b8 by @tgxworld. Feel free to signup at the Home Assistant Forums to see for yourselves.

For what it’s worth in terms of diagnosing this, desktop push notifications when the forum is not open in a browser tab have very recently started working for my forum here.

Okay, dug in even more. Set the custom user field using the Rails console directly. The checkbox now works (meaning its stuck on and the local storage key isn’t being reset on reload anymore, but I can’t toggle the box still). However, Chrome won’t register itself still. Neither will Firefox. I’m on Mac. I booted up my Pixel 3 and it registered fine. I am confirming that registration has(n’t) happened by using the Rails console to check all PushSubscription's for my user ID. I saw the Android registration pop up, but not the Chrome or Firefox registrations.

I figured it out!!

I’m on a Mac running Chrome. I realized the required service worker wasn’t ever being registered. It took me a while to figure it out, but eventually I found a recent comment from @sam here saying the service worker is disabled on any Apple devices. I set a breakpoint before the check is done and faked out the navigator.platform property (thanks to this StackOverflow post for the tip!) like so:

var fakePlatformGetter = function () {
  return "Windows";
if (Object.defineProperty) {
  Object.defineProperty(navigator, "platform", {
    get: fakePlatformGetter
} else if (Object.prototype.__defineGetter__) {
  navigator.__defineGetter__("platform", fakePlatformGetter);

Continue running, service worker was registered fine and the entire UI, saving the checkbox, everything, started working just fine.

It seems the service worker was disabled on all Apple platforms (over a year ago I might add) due to it not being used for any features & service workers causing problems. Obviously now we do need to use the service worker on Apple platform (at least Mac) to be able to receive push notifications.

I’ve gone ahead and submitted a PR to re-enable the service worker on Apple platforms. Will be glad to see this merged soon so that I and others can finally have push notifications!!

There were boatloads of customer support issues with this in the past (in Safari), so it is unlikely we are just going to flip it back on.

That’s fair and good feedback. I’m more than happy to rewrite the conditional to block out all browsers except Chrome and Safari on Mac. Would that be acceptable?

We already have that change done and pending in this branch Comparing master...offline · discourse/discourse · GitHub which will be tested in the following weeks now that we released a stable release and can experiment with riskier stuff

Context about that set of changes is here:


No. no luck here.

I still receive push notifs on FF browser only when the forum (whether Meta or my own forum) is open in at least 1 tab.

Woohoo! Thanks so much @Falco, will close my PR in light of these developments.


I would love to deploy Meta with this changes next week, so keep an eye on it. Also, since you know your way around, I would love another pair of eyes on the changes in that branch.


Please, you give me too much credit, I was just determined to get push working :slight_smile:

I really don’t have that much experience with service workers but a quick look and it seems fine.

I tried to signup to be able to test push notifications but seems I’m unable to as I never get the email. Not a big worry though as I don’t see that you did any changes to push code specifically in your branch.


Hi @robbiet480 was your problem ever solved ? I am also experiencing that the desktop notification toggle not persisting between refreshes, hence, no notifications