-
Notifications
You must be signed in to change notification settings - Fork 546
Dosent Work with Chrome on Android #118
Comments
Edit: The website runs on http. Does chrome need https on android? |
You can still use the (old) Notification(title, options) constructor and it’ll work on some (desktop) platforms. But (as I guess you know), it doesn’t work in Chrome for Mobile (Android). What does work on Chrome for Mobile is the ServiceWorker-based showNotification(title, options) approach. But per the Service Workers spec, you can only use Service Workers in secure contexts (in order to protect users from the risks associated with insecure contexts). So if you want something that will work for Chrome for Mobile users, then the answer is, No, it’s not possible to use Web Notifications in Chrome for Mobile without Service Workers (and so also, without deploying an SSL certificate for your site). |
I have the same issue which @mschweiger90 explained above while I have https Thanks you |
Thanks @danieluyo |
Could you give us documentation or code about how your resolve it? I have https site and I have my serviceWorker.min.js file on same folder with push.min.js but still not working. |
Hi Eric, you need a sw.js file in your document root / with a fetch event, for example:
Then you have to register the service worker inside your html head, for example:
Thats it, push.js should now work. Here you can find a full documentation: https://developers.google.com/web/fundamentals/primers/service-workers/ Its also possible to trigger a push without push.js. Its now native supported by chrome with action buttons. You can find code examples in the docu. Best regards |
hi @mschweiger90 , |
@Arqamshakeel Please provide a link that we can see this on. Thanks. |
On Android it doesnt work with chrome. Firefox works great on Anroid!
Anroid asked me in chrome if i want to allow notifications, but aber submit that, nothing happens.
If have the push.min.js and the serviceWorker.min.js in the same file via gulp.
The "Push.create()" method comes after that in a "$(document).ready(function()" function.
Is there any known solution for that?
Thanks for your help!
The text was updated successfully, but these errors were encountered: