Company
Date Published
Author
Hod Greeley, Developer Advocate, Couchbase
Word count
3655
Language
English
Hacker News points
None

Summary

Urban Airship is a messaging and notification service that can be used in conjunction with Couchbase Mobile to trigger data synchronizations on mobile devices. The setup process involves integrating Urban Airship with an Android or iOS project through a series of steps that include modifying gradle scripts, creating an Application class, and configuring Firebase Cloud Messaging. The guide details how to use Urban Airship to send push notifications that trigger unidirectional data replications in Couchbase Mobile, using a Sync Gateway as the cloud component. This approach helps to manage battery consumption by reducing the need for continuous network connections and takes advantage of Urban Airship's advanced features for targeting specific devices. The example provided demonstrates the integration through implementing classes like Autopilot and AirshipReceiver, setting up a main activity to display document changes, and using a database helper class to manage Couchbase Lite functionality. The tutorial also covers testing the setup using an Android emulator and Sync Gateway, and provides guidance on posting push notifications via Urban Airship's API to initiate database replications or reset the database.