XF 2.2 Push notifications - No supporting on this device

Scandal

Well-known member
I'm not sure when the problem starts, but I can't enable push notifications on my xF2.2 board.

On admin panel shows that my server supports them (and some time before they were working as expected).

Today I upgraded my board to xF2.2 and enabled PWA, when I realized that I can't enable push notification on account/preferences user control panel.

The button is disabled and says that is not supporting on my device.

I tried with Firefox (Windows 10 PC) and Chrome for Android (on my Android smartphone).

Any idea what could I check to detect the bug? :)
 
So if the button shows up, that generally means the server side is fine. Other than that, the detection does generally come down to the browser capabilities working as expected.

I would run a file health check to confirm everything is in position as expected. If it is, then I'd check the browser console for error messages.
 
So if the button shows up, that generally means the server side is fine. Other than that, the detection does generally come down to the browser capabilities working as expected.

I would run a file health check to confirm everything is in position as expected. If it is, then I'd check the browser console for error messages.
oh yes, you're right. I had forgot that the button is generated after page load.

Well, this is what I get on console:
navigator.serviceWorker.register threw an error.
This is from core-compiled.js:
JavaScript:
    XF.PushToggle = XF.Element.newHandler({
        options: {},
        isSubscribed: !1,
        cancellingSub: null,
        init: function() {
            XF.Push.isSupported() ? "denied" === Notification.permission ? (this.updateButton(XF.phrase("push_blocked_label"), !1), console.error("Notification.permission === denied")) : this.registerWorker() : (this.updateButton(XF.phrase("push_not_supported_label"), !1), console.error("XF.Push.isSupported() returned false"))
        },
        registerWorker: function() {
            var a = this;
            XF.Push.registerWorker(function() {
                a.$target.on("click", XF.proxy(a, "buttonClick"));
                c(e).on("push:init-subscribed", function() {
                    a.updateButton(XF.phrase("push_disable_label"), !0)
                });
                c(e).on("push:init-unsubscribed", function() {
                    a.updateButton(XF.phrase("push_enable_label"), !0)
                })
            }, function() {
                a.updateButton(XF.phrase("push_not_supported_label"), !1);
                console.error("navigator.serviceWorker.register threw an error.")
            })
        },

Just some tips where to investigate? :)
 
Looking at the site you've listed for your license, the service worker appeared to be registered as expected in Firefox and Chrome for me, so this may ultimately be a browser configuration option or extension which is blocking the service worker. You might want to confirm on a fresh profile to potentially try to eliminate that issue.
 
I still not be able to get push notifications work. :(

I have try to change browser and device but still not.

Also asked other members of my forum and they see the No supported on this device message.

I can do any test you could suggest me since I'm a developer too.
Looking at the site you've listed for your license, the service worker appeared to be registered as expected in Firefox and Chrome for me, so this may ultimately be a browser configuration option or extension which is blocking the service worker. You might want to confirm on a fresh profile to potentially try to eliminate that issue.
 
Update: it seems that something have to do with my forum's style. Not the addons.
If I choose the default xF style, I can enable push notifications.

Is there any related template that have to do with the push notifications?

I'm investigating...

edit: ok found the issue. It was an outdated template "notice_enable_push" :)

Thanks and sorry for any inconvinience!
 
Update: it seems that something have to do with my forum's style. Not the addons.
If I choose the default xF style, I can enable push notifications.

Is there any related template that have to do with the push notifications?

I'm investigating...

edit: ok found the issue. It was an outdated template "notice_enable_push" :)

Thanks and sorry for any inconvinience!
You did us a solid by posting it here after you fond a solution.
 
Back
Top Bottom