Home / Companies / Couchbase / Blog / Post Details
Content Deep Dive

Tutorial: Implement Android Push Notifications in your Couchbase Mobile app

Blog post from Couchbase

Post Details
Company
Date Published
Author
James Nocentini, Technical Writer, Mobile, Couchbase
Word Count
1,151
Company Posts That Month
7
Language
English
Hacker News Points
-
Post removed?
No
Summary

Using push and pull replication in continuous mode can be helpful when developing an application, but it can also have an impact on battery life. An alternative to continuous pull replication is using Google Cloud Messaging (GCM) to send push notifications to Android devices. To implement GCM syncing in an application, a new Google API project must be created and the device token retrieved from GCM. A wakeful service kicks off the GcmMessageHandler class, which performs a one-shot pull replication of data from Sync Gateway when a notification is received. The user profile document stores the device tokens, and changes to the database are monitored through the Sync Gateway Changes Feed endpoint, which returns a sorted list of changes made to documents in the database. When a change is detected, the GcmMessageHandler class sends a request to Google Cloud Messaging servers with the API Key and notification payload.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.