Nickersoft / push.js

The world's most versatile desktop notifications framework :earth_americas:

Home Page:https://pushjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notifications are not silent in chrome

NamanSharma5 opened this issue · comments

Hi I am trying to use the silent option of Push.js but it is still making noise in Chrome, when I receive notifications. I am running this on a server with the files stored under the public directory.

My code is:
Push.create('Message',{
timeout:5000,
onClick: function(){
window.focus();
this.close;
},
silent:true
}

Help me please.

Thank you.

Does push.js even shows notification in chrome if you are using localhost,i.e , http connection..In my case it is working well in edge but i cant see any notification in chrome ? So, I infer that chrome is blocking notification on sites with insecure http connection as it blocks Notifications from Notification API.

Notification API should work fine in localhost. Please check that you have not denied push permission.

No , I have allowed notifications and popups . The promise is being fulfilled, it is just that notification is not showing up.

Please specify the OS and Browser versions. Thanks

OS -Windows
Chrome Version - 84

Returning to the principal issue, @theLufenk , @kg-kartik , @vlazar & @Calinou do you know why silent notifications are not working? I have made sure to the pass in the silent: true parameter and my notifications are coming through - just not silently.
I am using localhost for dev and heroku for live versions. Does not work on Chrome or Firefox (both run on Windows).

Sample code:

                        Push.create('Sit',{
                            tag: 'Warning',
                            body:"Hi ",
                            timeout:5000, //in ms
                            onClick: function(){
                                window.focus();
                                this.close;
                                },
                            silent:true
                            }
                        )

@NamanSharma5
silent is only supported on Mobile Chrome in the latest version.

Would be simple enough to add support for it here I believe.

A Pull Request is always welcome :)

@kg-kartik Could you please open a separate issue for your question. Thanks.

@theLufenk Why not just use all of the fields found under Notification API Instance properties?

As of now, only body, icon, tag, and requireInteraction are actually used, out of the 15 that are provided in the API.

I submitted #286