Comments (12)
Currently investigating this issue on mobile Chrome (Android N). It seems to be throwing the following error:
Uncaught TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.
As it turns out, mobile Chrome does not support the new Notification()
constructor (as it is being depreciated) and instead requires a service worker. Some justification as to why can be found here. This should be a fairly straight-forward fix though. Working on it :)
from push.js.
Just checking now, it seems that the Notifications API in general is not supported on iOS, in neither Chrome or Safari. According to this Verge article from last year, Chrome still cannot send push notifications on iOS. Looks like Apple will once again need to play catch-up with Google.
from push.js.
Damn iOS always has to complicate everything.
from push.js.
Theoretically, it should work cross-platform, but mobile devices were never tested. I actually started this project to complement a desktop-oriented website I was building, so I never thought of testing it on phones. However, now that more people are using it, I'll definitely look into what the issue might be.
from push.js.
A quick update on this issue: apparently the new ServiceWorker approach requires the host site to use SSL in order to function properly. SSL is enabled on the GitHub page, but I'm trying to get a local SSL server running to test before I commit anything.
from push.js.
Exciting news! Mobile chrome support was just added with 4edcc9d. You can even make the device vibrate when you get a notification :) Enjoy! Let me know if you run into any bugs. Closing this for now.
from push.js.
Great! You're fast! :)
Is it correct that the demo wasn't updated yet? At least it doesn't work there.
Did you also test is on other mobile browsers (Safari, etc).
Thanks!
from push.js.
Apparently mobile Safari doesnt even have the ability to send push notifications, so it was not tested. And the demo was updated, although the site needs to be using a valid SSL certificate in order for it to work properly (something mobile Chrome requires, not me). So try https://nickersoft.github.io/push.js/demo.html.
from push.js.
Great! It works on Android. However on IOS on an Iphone it still doesn't work. Would be great if that is supported as well! You rock!
from push.js.
Haha thanks. As I said, Safari on iOS does not support the Notifications API (which sucks I know), so until it does there's nothing I can do about it :/
from push.js.
Apologies, I ment Chrome on IOS.. :)
from push.js.
On my mobile notification not shown.
from push.js.
Related Issues (20)
- incomplete types HOT 2
- Notifications are not silent in chrome HOT 10
- How to used with angularJS 1.x ? HOT 1
- Notifications not showing up in Chrome HOT 7
- pushjs.org View Demo button does nothing HOT 1
- click on notification opens a new instance of the url in new tab HOT 2
- Chrome Notification Center URL goes to the homepage HOT 1
- Support for actions HOT 1
- Instruction on how to set up in Nuxt project HOT 2
- Persist notification on electron
- on Mobile Chrome browser New Window does not open on Onclick
- Close specific notifications before end of timeout
- How do I specifiy what folder the icon is in?
- Are pushed notifications cached?
- How to associate a device to a user?
- I have installed push.js but it still don't run on node.js backend HOT 3
- Hello, the notification popup cannot be displayed in Apple M1 Chrome HOT 1
- Can I send notifications to people who use my website?
- iOS 16.4 or later and Webpages in Safari 16
- Any Way To Use In Frontend (JS of Website)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from push.js.