Google Cloud Messaging: State of the Union

Laurence Moroney
4 min readintermediate
--
View Original

Overview

Google Cloud Messaging (GCM) is a robust messaging infrastructure that enables reliable message distribution across multiple devices. The article discusses its capabilities, including message delivery techniques and the introduction of new APIs for iOS integration.

What You'll Learn

1

How to implement messaging for single devices using unique registration tokens

2

Why using device groups can enhance user experience across multiple devices

3

How to leverage topics for efficient message distribution to user interest groups

4

How to migrate existing infrastructure to support iOS notifications with GCM

Key Questions Answered

What is Google Cloud Messaging and how does it work?
Google Cloud Messaging (GCM) is an infrastructure that facilitates reliable messaging to distribute messages across various devices. It delivers over 150 billion messages daily to platforms including Android, iOS, and web browsers, using techniques like single device messaging, device groups, and topics.
What techniques does GCM use for message delivery?
GCM employs several techniques for message delivery, including targeting single devices with unique registration tokens, bundling devices into groups for collective messaging, and creating topics for interest-based messaging. This flexibility allows developers to cater to various user scenarios effectively.
How reliable is message delivery with GCM?
An internal study at Google revealed that 95% of notification messages are delivered within 250 milliseconds to connected devices. Factors such as network conditions can affect delivery, but users will still receive notifications once they reconnect to the internet.
What resources are available for developers using GCM?
Developers can access various resources to build applications with GCM, including a step-by-step video tutorial for creating an Android app and server in PHP, as well as an open-source 'GCM Playground' on GitHub that provides sample server implementations.

Key Statistics & Figures

Daily message delivery
150 Billion
This statistic highlights the scale and reliability of GCM in delivering messages across various platforms.
Message delivery latency
250ms
95th percentile of notification messages are delivered within this time frame to connected devices.

Technologies & Tools

Messaging Infrastructure
Google Cloud Messaging
Used for distributing messages to various devices reliably.

Key Actionable Insights

1
Utilize device groups in GCM to streamline messaging across multiple devices owned by a single user.
This approach not only improves user experience but also ensures that actions taken on one device, such as dismissing notifications, can be reflected across all devices.
2
Implement topic messaging to enhance user engagement by sending targeted messages based on user interests.
By allowing users to subscribe to topics, developers can ensure that their messages are relevant and timely, leading to higher engagement rates.
3
Consider using the new API for migrating existing iOS infrastructure to GCM without requiring client code changes.
This can significantly reduce the effort and time needed to integrate GCM into existing applications, making it easier to reach iOS users.

Common Pitfalls

1
Failing to account for varying connectivity conditions can lead to missed notifications.
Users may disable mobile data to save bandwidth, which means notifications will only be received once they reconnect. Developers should design their applications with this behavior in mind.