chrome-gcm

PushManager subscription promise never fulfill nor reject

独自空忆成欢 提交于 2020-01-01 04:55:13
问题 I am currently facing an issue with some Chrome (Chromium) version where the PushManager.subscribe promise from a ServiceWorker stays in a pending state . The code itself is pretty simple : return serviceWorkerRegistration.pushManager.subscribe({ userVisibleOnly: true }); I have a valid and accessible JSON manifest , providing the GCM Sender ID . I also tried different implementations, as described in this post, but the result is still the same. The subscription part works well with every 47+

GCM Chrome: Empty Data Response

筅森魡賤 提交于 2019-12-14 04:26:00
问题 i am currently integrating gcm in my web application, the subscription and the registration_id saving working, i get on the client also the response, when i trigger a message from Postman. So now i need to transfer the title and the message. i am triggering the gcm api with this parameter: http://i.imgur.com/MkrIAzF.png and thats the received from the client: http://i.imgur.com/gSZtEiY.png The Field "data" is everytime empty, 回答1: Despite using GCM as its push service, Chrome doesn't support

Rate Limit Exceeded error when using Google Cloud Messaging API

巧了我就是萌 提交于 2019-12-14 00:15:59
问题 When using the Google Cloud Messaging API to send messages between a backend server and an Android/Chrome client, the backend server can, at times, receive a rate limit exceeded response code. This code is “DeviceMessageRateExceeded” for a HTTP Connection Server and “DEVICE_MESSAGE_RATE_EXCEEDED” for a Cloud Connection Server. What is this error code and how should it be managed? 回答1: The rate limit exception code indicates that you are sending messages from a backend server too frequently.

Can service-worker stop push notification sent by GCM api?

删除回忆录丶 提交于 2019-12-12 18:07:09
问题 In my current architecture, I submit push notifications using the GCM API. This triggers a 'push' event in the service worker. The service worker then adds some data to the notification. If the service worker is unable to add the data, due to some error, I am getting a blank notification. Can service workers avoid showing notifications sent by GCM? 回答1: From the Push Notifications guide at Google Developers: You must pass a {userVisibleOnly: true} argument to the subscribe() method. This

GCM webpush in background

两盒软妹~` 提交于 2019-12-11 03:56:07
问题 I implemented web push notifications. Steps to get a bug: Open website Subscribe for push notifications Send many pushes through gcm - all fine Close tab with site Send push and receive "double push" - first one is ok, second is "This site has been updated in background" Reopen website Send push - all fine I know this can happen when the service worker receives push and doesn't show notification. But I see normal notification, why I also see other strange notification? Can I get rid such

Chrome App pushMessaging does not work when background page is inactive

眉间皱痕 提交于 2019-12-08 05:06:16
问题 manifest.json: { "app": { "background": { "scripts": [ "background.js" ] } }, "key": "...", "manifest_version": 2, "name": "Push Sample", "permissions": [ "notifications", "pushMessaging" ], "version": "1.0" } background.js: chrome.runtime.onInstalled.addListener( function() { chrome.pushMessaging.onMessage.addListener( function (message) { chrome.notifications.create( '', { type: 'basic', iconUrl: 'icon24.png', title: 'The Title', message: message.payload }, function (notificationID) { } );

PushManager subscription promise never fulfill nor reject

人走茶凉 提交于 2019-12-03 13:57:28
I am currently facing an issue with some Chrome (Chromium) version where the PushManager.subscribe promise from a ServiceWorker stays in a pending state . The code itself is pretty simple : return serviceWorkerRegistration.pushManager.subscribe({ userVisibleOnly: true }); I have a valid and accessible JSON manifest , providing the GCM Sender ID . I also tried different implementations, as described in this post , but the result is still the same. The subscription part works well with every 47+ version, the issue appears with older releases. (I'm using Chromium continuous builds to test the

GCM registration id in Service Worker in Push Notification for chrome

百般思念 提交于 2019-12-03 12:42:50
问题 I am able to send push notification and in service worker i am making a service call i just to want to send GCM registration id with that service call. How to get registration id or subscription id in service worker here is my code self.addEventListener('push', function(event) { console.log('Received a push message from local', event); var title = 'My title file. Testing on'; var body = 'New Push Message.'; var icon = 'refresh_blueicon.png'; var tag = 'my-push-tag'; event.waitUntil( // Here i

How to get registered into GCM topics from javascript (for Chrome)

喜夏-厌秋 提交于 2019-12-01 06:06:05
Here is a nice documentation on how to implement Google Cloud Messaging (GCM) in Chrome. But I do not found any reference here or anywhere how to subscribe to a topic using javascript (for Chrome). Here I have found a reference how to do the task for Android: https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic Java code(Android) for subscribe to a topic in GCM: private void subscribeTopics(String token) throws IOException { GcmPubSub pubSub = GcmPubSub.getInstance(this); for (String topic : TOPICS) { pubSub.subscribe(token, "/topics/" + topic, null); } } WHAT I

How to get registered into GCM topics from javascript (for Chrome)

回眸只為那壹抹淺笑 提交于 2019-12-01 03:42:36
问题 Here is a nice documentation on how to implement Google Cloud Messaging (GCM) in Chrome. But I do not found any reference here or anywhere how to subscribe to a topic using javascript (for Chrome). Here I have found a reference how to do the task for Android: https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic Java code(Android) for subscribe to a topic in GCM: private void subscribeTopics(String token) throws IOException { GcmPubSub pubSub = GcmPubSub