Nickersoft / push.js

The world's most versatile desktop notifications framework :earth_americas:
https://pushjs.org
MIT License
8.77k stars 548 forks source link

Push notification not working in IE 11, no errors #136

Closed kartolab closed 5 years ago

kartolab commented 6 years ago

Hi, thanks for this wonderful library. I am trying to implement this in our project where 99% of the users uses IE browser (working in FF). I was getting "promise" undefined error at the beginning but errors are gone after including the below:

My full test code is below. Please can you help.

`

PushJs Notification
<!-- Automatically provides/replaces `Promise` if missing or broken. -->
<script src="http://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script>
<script src="http://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> 
<script src="js/push.min.js"></script>

` Thanks, Karthik
Nickersoft commented 6 years ago

Hi @karthikm19, first of all, thanks for using the library! Second of all, this is a very well-known issue to me and seems to be a Windows-only issue that I still need to look into (I myself am a Mac user). There's an active discussion going on in #119 of users reporting similar issues. I'll keep everyone posted when I come up with a fix. I'm so sorry for the inconvenience!

kartolab commented 6 years ago

Hello, thanks very much for your quick response. My project is still in development phase and need this in production by early next year. Do you think IE issue will be fixed by then ? or any other alternative solution which works in IE to desktop notify users?

Nickersoft commented 6 years ago

@karthikm19 I'll give it a look tomorrow, and should have a better idea then of how complex a fix might be. I'll let you know.

Nickersoft commented 6 years ago

@karthikm19 I just re-read your issue and realized that ES6 promises, which this library uses, is not supported by any version of IE (as seen here. Therefore you need a polyfill in order to make it work. Originally, this library came with a polyfill built-in, but it only added to the size of the outputted JS. After realizing most modern browsers support Promises, I decided to leave polyfills up to the user to implement. To clarify though, with the polyfills, your code does in-fact work?

kartolab commented 6 years ago

Thanks T Nickerson, great news! I will remove ES6 cdn and use the below polyfill and let you know the outcome tomorrow. Tested from home using a simple html script in my local but IE is blocking it. Will test with web server and let you know tomorrow. //cdnjs.cloudflare.com/ajax/libs/js-polyfills/0.1.41/polyfill.js

kartolab commented 6 years ago

Hi @Nickersoft, I have tested with both the below polyfill promises and still not getting the notification in IE 11. Please can you help? Thanks in advance

https://github.com/taylorhakes/promise-polyfill https://cdnjs.cloudflare.com/ajax/libs/js-polyfills/0.1.41/polyfill.js

kartolab commented 6 years ago

Hi @Nickersoft, please can you send me a sample html code which works in IE 11, which would be great? Thanks

jorisw commented 6 years ago

Any way you could add this polyfill to your demo on your home page at least? So it can be tried out on IE before deciding whether to use it?

Nickersoft commented 6 years ago

So guys, double-checking https://caniuse.com, it would appear no version of Internet Explorer supports desktop notifications:

https://caniuse.com/#feat=notifications

jfi commented 6 years ago

@Nickersoft Any chance you could update https://pushjs.org/docs/introduction, which says:

the Notification API allows modern browsers such as Chrome, Safari, Firefox, and IE 9+ to push notifications to a user’s desktop

Could you amend this to clarify IE isn't supported? I lost a bit of time digging around until I found your reply here.

Thanks for a great library!

RyanKys commented 6 years ago

Could you provide a sample for Edge? It should support web notifications spec. as mentioned in Nickersoft 's link: https://caniuse.com/#feat=notifications

kartolab commented 6 years ago

I am using this in my project and I confirm that push notification works in Edge without any issues.

joc138 commented 6 years ago

bump please update docs

Y-k-Y commented 5 years ago

It still says it support IE 9 + at the README

the Notification API allows modern browsers such as Chrome, Safari, Firefox, and IE 9+

Please update it