Ok…I think there is a problem, because live browser notifications are not working. Do they only work when one is currently ON that website?
They’ll work if you have a window open on the website, or if you have the mobile PWA installed.
Is your site using https? Is
@supermathie perhaps that is what I am missing…the mobile PWA. I will give that a try. Do users also need to “watch” categories, or can that field in settings remain blank? I am trying to simplify the process for users to enable notifications. I was hoping that by me setting certain categories to watch by default in settings that they would not have to take that extra step of watching categories. As it is, they have to go to their preferences to enable live notifications, and now it is looking like they need to download the PWA. Still, I am bewildered as to why the user prompt is not appearing at the top of the page.
@Stephen it is funny you mention that, because “force Https” does not appear in my settings. I was running a test Discourse forum on another domain and with another host before launching a new domain with a new host. I no longer see the “force https” in the settings. Https is active, though, or at least that is what the url indicates.
How was this instance installed?
I followed the same steps…I thought the change was due to a Discourse core update, and until now I did not pay much attention to the issue. The only difference was the new domain, and the new host. I am using the Material Design Theme with custome header links and discourse social share components. These are the plugins installed:
The forum is found here https://caseclosed.world
force https is hidden automatically when using Let’s Encrypt.
Your PWA settings look fine - I get prompted to add it on my Android. Have you tried adding it to see if you get mobile notifications?
I downloaded the Discourse app, selected my domain when prompted to choose a forum, and added it to my home screen. I am signed in on the PWA and live notifications are enabled. I am attaching a little video that shows what I did.
TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead. at https://example.com/assets/application-[spoiler]4f3f9a6090af98121b9336075c31d028a231c99ffbd60bb8ae119baff3133d88.js:12:27295[/spoiler] at f (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:17:29538)[/spoiler] at T (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:17:30915)[/spoiler] at https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:17:31429[/spoiler] at t.invoke (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:16:6937)[/spoiler] at e.t.flush (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:16:5930)[/spoiler] at e.t.flush (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:16:7980)[/spoiler] at e.r._end (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:16:12654)[/spoiler] at MutationObserver._boundAutorunEnd (https://example.com/assets/ember_jquery-[spoiler]a40c13c332a81d765d3281335e4a756ef34f0d72a592a96b7e7b37b022328f29.js:16:8905)[/spoiler]
I can provide you the full links if it helps you, but I blurred them to the public. Let me know if you need the full url’s and I would be happy to provide. Thanks again for your help with this.
Also, I just followed the same steps with the meta.discourse.org forum, and I received the prompt to enable notifications.
I just realized you said that my forum prompts you to “add it” on your Android. Do you mean to say that my forum is prompting you to enable notifications? If so, that is very interesting since it does not prompt me on my android, yet the meta.discourse forum DOES prompt me. I am really scratching my head on this. The meta.discourse is prompting me on my desktop, but my forum is NOT prompting me on my desktop. I have tried Chrome and Edge browsers, and both give me the same result.
Do you have any suspicions as to the cause?
There is a lot of confusion here in this topic. Let’s start over:
Discourse Hub App
Android Google Chrome
- You can enable push notification from the browser. You will be prompted to do so in a banner after posting your first reply and having TL1. You can also enable it anytime in your profile. You don’t need to add the app to the homescreen to do so (for now).
It looks as though this may be due to a custom plugin on your site - if you run in Safe Mode do you get the same error?
Copy that…regarding the Discourse Hub app, you clarified why I am having difficulty with the app. Regarding Android Google Chrome, I was using a different browser on my Android, which explains that issue. I can confirm now that I get the prompt when using Android Google Chrome.
So, it is all starting to make sense. I am wondering if I can bother you for some direction now. Being that I do not use discourse.org hosting, what do you recommend I do if I want to provide push notifications in other browsers on Android, or to iOS? I am guessing I can install the discourse plugin for desktop notifications to resolve that issue. I was hesitant to do that at first because I understood, from the forums, that discourse core already provided push messaging, and therefore a plugin was unnecessary. Feel free to shoot me straight on this.
I have removed many of the plugins I was using, and I can confirm I no longer get that error. I will add back the plugins, one by one and over the course of a week, to determine which plugin causes that error. Thank you for catching that it is due to a custom plugin. These are the plugins I am currently using:
It does work fine on Firefox on Android, but we don’t support that browser. It works because it adheres to the same web standard every modern browser implements.
iOS Safari browser don’t implement the Web Push Notification web standard, so there is nothing we can do here.
That plugin only “unhides” the web push button for desktop browsers. Support is still the same, Chrome, Firefox & Edge, on the Desktop and Android. We only hide this button on desktop because most people don’t want notifications when the browser is closed on the desktop (and you are playing a game, fullscreen and dies because of the notification lag ).
Thank you so much for the clarification. It sounds like I will recommend to my users to utilize Chrome on Android as my preference, and Firefox if that is their preference. You make a good point on desktop notifications, so I will steer clear of that for now. If Android and Firefox push notifications are the best I can hope for at the moment, that is perfectly fine. I just wanted to make sure I was providing whatever push notification functionality was available, short of using discourse.org hosting. Nothing against discourse.org, though.
I’m sure there would be a lot of us self hosted users who would pay for a service via official hosting for whatever server authentication is needed (pass through from our server), for push notifications.
Most of us self hosted users don’t need paid hosting at $100+/mo, but offer a $10-20/mo service that we install a plug-in that forwards notifications to discourse hosting and on to our hub app. I’d happily sign up!
That’s not planned, sorry.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.