• Browser Push Notification

How Push Notifications are Delivered On Firebase Cloud Messaging?

Last updated on Aug 20, 2022

Read More

How Push Notifications are Delivered On Firebase Cloud Messaging?

Chrome and other leading browsers ( including UC Web, Chromium based browsers such Samsung Internet, Opera) use Firebase Cloud Messaging (FCM) to deliver web push notifications to users devices. While push notifications can be delivered even when the user is not on the website, there are other parameters that can directly impact notification delivery. It is also important to understand the difference between Notification delivery and view-ability.

The standard responses from FCM ( or GCM ) only tell you about notification messages being "sent" to FCM( Firebase Cloud Messaging). Almost all the push notification service providers out there including iZooto, use FCM for delivering push notifications to desktop and mobile devices. The actual notification delivery can be tracked only by service worker (notifications on the device are shown by service-worker). This can be tracked for all browsers with the exception of Safari.  

With this article we wanted to take a shot at explaining the concept notification delivery and how that gets impacted over time. We will also cover web push notification delivery process and the various response codes that FCM provides. To push a notification, you need to call FCM( or GCM API) to invoke push notification functionality for a subscriber. GCM further returns response for every subscriber stating if push notification delivery was successful or if there were failures in delivery. There can be multiple reasons for failures however error codes returned by GCM explain exact error conditions in each scenario.

Common Scenarios and Error Messages

  1. Invalid Registration: Subscriber browser key aka registration token is used as an identifier while pushing a notification. This key is generated by browser when any user subscribes to notifications, each subscription generates unique browser key. If the key provided is incorrect, FCM/GCM would return error stating that the key is invalid. This error doesn't occur unless the browser key is modified.
  2. Mismatch SenderID: Both FCM/GCM requires sender ID to push notifications, be it for native app notifications or web push notifications. Browser keys can be associated with a group of sender IDs which are allowed to push notifications. Sender ID is used to identify correct sender. If the subscription is registered against a sender ID, the same sender ID should be used while sending notifications otherwise GCM throws MismtachSenderID error. As a website owner, you need to ensure that you use same sender ID while taking subscriptions and sending notifications.
  3. Not Registered: Chrome provides existing subscribers an option to unsubscribe from notifications in notification settings. When users unsubscribe, their subscription key becomes invalid. When you try to push notifications to these users, GCM returns 'NotRegistered' status against all such users. It's very important for website owners to send relevant notifications and not to spam users with notifications to keep lower churn/un-subscription rate.

There are few other errors that arise if input parameters are incorrect, here is a list of error codes for GCM and their description. Given that GCM is being replaced by FCM, it is recommended that the error code list for FCM should be referred to. 

Subscriber keys without any error response can be considered as accepted for push notification delivery by GCM however actual push notification delivery depends on TTL mentioned in notification and whether the user is connected to internet or not. GCM delivers notification to all connected users immediately and to all disconnected users as soon as they're back online provided that TTL for notification doesn't expire.

If you're using any third party web push notification vendor, do ensure that you get these details for every notification sent. iZooto platform provides this information for each campaign for customers to analyze push notification delivery in detail.

All Posts
Shrikant Kale
Shrikant Kale
Shrikant R Kale, our very own SRK, is the Product Head at iZooto. An IIM-C product, he is looked up to for his dedication and calm demeanor. This passionate bike-lover can be easily spotted in our office 24*7 (almost!). Follow him on twitter: @shrikantkale

Related Posts

WordPress Donation Plugins for Publishers: Which One is Right for You?

Digital publishers either rely on ad revenue or add paywalls to genera[...]

How Google Won the Content Recommendation Game

In the world of adtech, products are copied all the time. When Faceboo[...]

Publisher Guide for Sponsored Podcasts

Publishers who’ve already monetized through sponsored articles and vid[...]