Giter Site home page Giter Site logo

Comments (12)

Nickersoft avatar Nickersoft commented on August 21, 2024 4

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.

Nickersoft avatar Nickersoft commented on August 21, 2024 1

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.

p10tyr avatar p10tyr commented on August 21, 2024 1

Damn iOS always has to complicate everything.

from push.js.

Nickersoft avatar Nickersoft commented on August 21, 2024

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.

Nickersoft avatar Nickersoft commented on August 21, 2024

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.

Nickersoft avatar Nickersoft commented on August 21, 2024

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.

rickgoud avatar rickgoud commented on August 21, 2024

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.

Nickersoft avatar Nickersoft commented on August 21, 2024

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.

rickgoud avatar rickgoud commented on August 21, 2024

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.

Nickersoft avatar Nickersoft commented on August 21, 2024

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.

rickgoud avatar rickgoud commented on August 21, 2024

Apologies, I ment Chrome on IOS.. :)

from push.js.

alimaaz avatar alimaaz commented on August 21, 2024

On my mobile notification not shown.

from push.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.