0

I have a Google Chrome Extension that listens for GCM messages in a background script via chrome.gcm.onMessage.addListener. Our provider is planning to upgrade their infrastructure to use the latest Firebase Cloud Messaging which is no longer compatible with GCM. We've confirmed the gcm addListener API no longer receives messages after upgrading to FCM in the dev environment.

I've found migration guides for Android, iOS, and progressive web apps but none specifically for background scripts in Chrome extensions.

Some resources I've found:

Jameal G
  • 324
  • 3
  • 10
  • I havent worked on Chrome apos before, but as far as GCM and FCM compatibility goes, they should still be functioning as expected. Is there any error appearing when sending the messages? – AL. May 04 '18 at 15:15
  • 1
    There's no error unfortunately. The messages simply aren't being delivered, or at least Chrome is not receiving them through its `chrome.gcm.onMessage.addListener` API. When using GCM I was able to use this API without requiring any client libraries. – Jameal G May 04 '18 at 16:02

1 Answers1

0

The extension that I mentioned in my question three years ago still exists today and continues to rely on the chrome.gcm extension API.

Recently we noticed the gcm.notification.badge value is no longer being passed along with the data object, instead we're seeing a gcm.notification.e property that I believe contains the badge value. I was unable to find any documentation on why that property changed but I did find an answer to my original question:

We are deprecating the chrome.gcm API and encourage you to move to Web Push Notifications using VAPID authentication. This works on the Web, in Chrome Extensions and in Chrome Apps. You can find more information here:

https://developers.google.com/web/fundamentals/push-notifications/

Web Push Notifications offer a slightly different set of features from the chrome.gcm API. Please file an issue or contact us directly if you believe that it cannot satisfy your requirements.

Source: https://bugs.chromium.org/p/chromium/issues/detail?id=831532

Jameal G
  • 324
  • 3
  • 10