push-api

getSubscription returns a null subscription

夙愿已清 提交于 2019-12-01 07:18:57
I am new to service workers and GAE, I am able to register the service workers but not able to subscribe the PushManager, getting subscription null error. Find the below code for reference. serviceWorkerRegistration.pushManager.getSubscription() .then(function(subscription) { var pushButton = document.querySelector('.js-push-button'); pushButton.disabled = false; if (!subscription) { console.log('subscription error '); return; } console.log('subscriptioned '); // Keep your server in sync with the latest subscriptionId sendSubscriptionToServer(subscription); // Set your UI to show they have

getSubscription returns a null subscription

核能气质少年 提交于 2019-12-01 05:10:56
问题 I am new to service workers and GAE, I am able to register the service workers but not able to subscribe the PushManager, getting subscription null error. Find the below code for reference. serviceWorkerRegistration.pushManager.getSubscription() .then(function(subscription) { var pushButton = document.querySelector('.js-push-button'); pushButton.disabled = false; if (!subscription) { console.log('subscription error '); return; } console.log('subscriptioned '); // Keep your server in sync with

Google Chrome Silent Push Notifications

戏子无情 提交于 2019-11-30 09:49:53
I've been reading through the docs for Chrome's implementation of the Web Push API here , and I noticed the API says "you promise to show a notification whenever you receive a push" and under limitations it's stated "you have to show a notification when you receive a push message". After implementing the example on my localhost, I used cURL to send a push notification successfully. I was curious, so I commented out the lines that actually call the showNotification function, and put in a console.log instead and found that I could, in fact, send, receive, and totally ignore a push notification.

Chrome Push Notification: This site has been updated in the background

烈酒焚心 提交于 2019-11-30 06:35:12
问题 While implementing the chrome push notification, we were fetching the latest change from our server. While doing so, the service-worker is showing an extra notification with the message This site has been updated in the background Already tried with the suggestion posted here https://disqus.com/home/discussion/html5rocks/push_notifications_on_the_open_web/ But could not find anything useful till now. Is there any suggestion ? 回答1: Generally as soon as you receive a push message from GCM

Can I use web push notifications to update the page without displaying a notification?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 12:11:10
I am wondering if I can use web push notifications to update a web page without displaying a notification for the user to interact with. Essentially I want to refresh data after an event on the server. If this is possible, is it still necessary to receive permission from the user to send these push updates? Yes, you can send push messages without showing a notification, but there are limitations on both Firefox and Chrome on the raw number of "invisible" push messages and the rate at which you send them. You can experiment a bit with the quotas in different browers using the Push Quota

Chrome Push Notification: This site has been updated in the background

微笑、不失礼 提交于 2019-11-28 21:10:32
While implementing the chrome push notification, we were fetching the latest change from our server. While doing so, the service-worker is showing an extra notification with the message This site has been updated in the background Already tried with the suggestion posted here https://disqus.com/home/discussion/html5rocks/push_notifications_on_the_open_web/ But could not find anything useful till now. Is there any suggestion ? Satyajit Dey Generally as soon as you receive a push message from GCM (Google Cloud Messaging) you have to show a push notification in the browser. This is mentioned on

Can I use web push notifications to update the page without displaying a notification?

守給你的承諾、 提交于 2019-11-28 05:47:49
问题 I am wondering if I can use web push notifications to update a web page without displaying a notification for the user to interact with. Essentially I want to refresh data after an event on the server. If this is possible, is it still necessary to receive permission from the user to send these push updates? 回答1: Yes, you can send push messages without showing a notification, but there are limitations on both Firefox and Chrome on the raw number of "invisible" push messages and the rate at

How can I do push notifications in an HTML5 Web application?

北城以北 提交于 2019-11-27 16:03:08
问题 I have a web application. I want to use the HTML 5 inbuilt notifications API to do push notifications from the server when the user is on a particular page. Is it possible? 回答1: You can do real push notifications with Web apps today in Chrome using Service Workers and PushManager from the W3C Push API. See the article Push Notifications on the Open Web for a step-by-step how-to and code snippets you can use. Here’s a diagram from that article that explains what the UI around it looks like. An

How to send push notification to web browser?

天涯浪子 提交于 2019-11-26 18:04:37
I have been reading for past few hours about Push Notification API and Web Notification API . I also discovered that Google & Apple gives push notification service for free via GCM and APNS respectively. I am trying to understand if we can implement push notification to browsers using Desktop Notification, which I believe is what Web Notification API does. I saw a google documentation on how this can be done for Chrome here & here . Now what am still not able to understand is: Can we use GCM/APNS to send push notification to all Web Browsers including Firefox & Safari? If not via GCM can we

How to send push notification to web browser?

痴心易碎 提交于 2019-11-26 08:53:59
问题 I have been reading for past few hours about Push Notification API and Web Notification API. I also discovered that Google & Apple gives push notification service for free via GCM and APNS respectively. I am trying to understand if we can implement push notification to browsers using Desktop Notification, which I believe is what Web Notification API does. I saw a google documentation on how this can be done for Chrome here & here. Now what am still not able to understand is: Can we use GCM