{"id":304,"date":"2015-04-26T09:00:41","date_gmt":"2015-04-26T16:00:41","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/"},"modified":"2015-04-26T09:00:41","modified_gmt":"2015-04-26T16:00:41","slug":"tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/","title":{"rendered":"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app"},"content":{"rendered":"\n<p><script src=\"\/webfiles\/1484262819972\/js\/thirdparty\/vendor\/prism.js\"><\/script><\/p>\n\n\n\n<p>When developing an application, it\u2019s very helpful to use the push and pull replication in continuous mode. Everything is handled by the replicators to make sure your app and Sync Gateway always have the latest documents synced.<\/p>\n\n\n\n<p>However, a continuous pull replication means that Couchbase Lite will be using techniques such as long polling or web sockets to check if there\u2019s new data to fetch from Sync Gateway. This can have an impact on battery life and consequently user experience.<\/p>\n\n\n\n<p>In this post, we will explore an alternative to continuous pull replication by using Google Cloud Messaging, Android\u2019s push notification service.<\/p>\n\n\n\n<p>You can check out a <a href=\"https:\/\/github.com\/couchbaselabs\/ToDoLite-Android\">working example<\/a>\u00a0in ToDoLite Android. Let\u2019s see how you can include GCM syncing in your application!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling GCM in your app<\/h2>\n\n\n\n<p>First, let\u2019s configure ToDoLite Android to register for Google Cloud Messaging.\u00a0We\u2019ll create a new Google API project on the <a href=\"https:\/\/developer.google.com\/console\">developer console<\/a>. Follow this <a href=\"https:\/\/developer.android.com\/google\/gcm\/gs.html\">guide<\/a>\u00a0to set it up. You should have a project number and API key. Now we can update the project\u2019s <strong>AndroidManifest.xml<\/strong> with the required permissions, intent filter and service. It should look like this:<\/p>\n\n\n<p>[crayon lang=&#8221;markup&#8221;]<br \/>\n \/\/ &#8230;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0 \/\/ &#8230;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/* &#8230; activities &#8230; *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>[\/crayon]<\/p>\n\n\n\n<p><strong>Note:<\/strong> Check out the <a href=\"https:\/\/developer.android.com\/google\/gcm\/client.html#manifest\">example<\/a>\u00a0from the android developer site as well.<\/p>\n\n\n\n<p>If the project is configured correctly, we can retrieve the device token with the project number we got when creating the app in the google developer console. Add a method in the Main Activity to retrieve the device token from GCM and save it on the user profile document for example:<\/p>\n\n\n<p>[crayon lang=&#8221;java&#8221;]void getDeviceToken() {<br \/>\n        new AsyncTask() {<br \/>\n            @Override<br \/>\n            protected String doInBackground(Void&#8230; params) {<\/p>\n<p>                GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(getApplicationContext());<\/p>\n<p>                String deviceToken = gcm.register(&#8220;632113338862&#8221;);<br \/>\n                Log.i(&#8220;GCM&#8221;, &#8220;Device token : &#8221; + deviceToken);<\/p>\n<p>                \/\/ update user profile document<\/p>\n<p>                return null;<br \/>\n            }<br \/>\n        }.execute(null, null, null);<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p><strong>Note:<\/strong> Device tokens on Android always start with APA91 so keep an eye out for them in LogCat ;)<\/p>\n\n\n\n<p>Next, we have to add some code to handle an incoming notification. We subclassed the WakefulBroadcastReceiver class where the onReceive method gets called every time we receive a notification.<\/p>\n\n\n<p>[crayon lang=&#8221;java&#8221;]public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {<\/p>\n<p>    @Override<br \/>\n    public void onReceive(Context context, Intent intent) {<br \/>\n        \/\/ Explicitly specify that GcmMessageHandler will handle the intent.<br \/>\n        ComponentName component = new ComponentName(context.getPackageName(),<br \/>\n                GcmMessageHandler.class.getName());<\/p>\n<p>        \/\/ Start the service, keeping the device awake while it is launching.<br \/>\n        startWakefulService(context, (intent.setComponent(component)));<br \/>\n        setResultCode(Activity.RESULT_OK);<br \/>\n    }<\/p>\n<p>}[\/crayon]<\/p>\n\n\n\n<p>From there, the wakeful service kicks off the GcmMessageHandler class and performs a one-shot pull replication. The wakeful service executes even if your app is running in the background. Then your app would show the new data accordingly when opening the app.<\/p>\n\n\n<p>[crayon lang=&#8221;java&#8221;]<br \/>\npublic class GcmMessageHandler extends IntentService {<\/p>\n<p>    \/* &#8230; *\/<\/p>\n<p>    @Override<br \/>\n    protected void onHandleIntent(Intent intent) {<br \/>\n        mIntent = intent;<br \/>\n        showToast();<br \/>\n        Application application = (Application) getApplication();<\/p>\n<p>        try {<br \/>\n            URL url = new URL(BuildConfig.SYNC_URL_HTTP);<br \/>\n            Replication pull = application.getDatabase().createPullReplication(url);<br \/>\n            pull.addChangeListener(getReplicationListener());<br \/>\n            pull.start();<br \/>\n        } catch (MalformedURLException e) {<br \/>\n            e.printStackTrace();<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>    private Replication.ChangeListener getReplicationListener() {<br \/>\n        return new Replication.ChangeListener() {<br \/>\n            @Override<br \/>\n            public void changed(Replication.ChangeEvent event) {<br \/>\n                Log.i(&#8220;GCM&#8221;, &#8220;replication status is : &#8221; + event.getSource().getStatus());<br \/>\n                if (event.getSource().getStatus() == Replication.ReplicationStatus.REPLICATION_STOPPED) {<br \/>\n                    GcmBroadcastReceiver.completeWakefulIntent(mIntent);<br \/>\n                }<br \/>\n            }<br \/>\n        };<br \/>\n    }<\/p>\n<p>    \/* &#8230; *\/<\/p>\n<p>}<br \/>\n[\/crayon]<\/p>\n\n\n\n<p>Notice we\u2019re using the replication change listener to get notified when it\u2019s done and to shut down the wakeful service.<\/p>\n\n\n\n<p>That\u2019s all we have to do on the Android side to handle the sync notification.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Saving the device tokens<\/h2>\n\n\n\n<p>Now we can store the device token on the user profile document. Each user may be logged into more than one device at a time so we should store each one of them. The user document will look like this:<\/p>\n\n\n<p>[crayon lang=&#8221;javascript&#8221;]{<br \/>\n &#8220;_id&#8221;: &#8220;profile:johnny@couchbase.com&#8221;,<br \/>\n &#8230;<br \/>\n &#8220;device_tokens&#8221;: [&#8220;APA91K&#8230;&#8221;, &#8220;APA91O&#8230;&#8221;]<br \/>\n}[\/crayon]<\/p>\n\n\n\n<p>In the next section, we\u2019ll talk about adding additional application logic to Sync Gateway using the Changes Feed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Sync Gateway Changes Feed<\/h2>\n\n\n\n<p>The <strong>\/database\/changes<\/strong> endpoint returns a sorted list of changes made to documents in the database. This endpoint is part of the CouchDB <a href=\"https:\/\/docs.couchdb.org\/en\/latest\/api\/database\/changes.html\">spec<\/a>\u00a0and both the Couchbase Lite Listener and Sync Gateway implement it.<\/p>\n\n\n\n<p>It\u2019s very easy to hook into the Changes Feed of Sync Gateway to add extra logic to the back-end such as, in our case, sending push notifications.<\/p>\n\n\n\n<p>You can use any library that implements the changes feed api:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>NodeJS: <a href=\"https:\/\/github.com\/djc\/couchdb-python\">https:\/\/github.com\/iriscouch\/follow<\/a><\/li>\n\n\n<li>Go: <a href=\"https:\/\/github.com\/djc\/couchdb-python\">https:\/\/github.com\/fjl\/go-couchdb<\/a><\/li>\n\n\n<li>Python: <a href=\"https:\/\/github.com\/djc\/couchdb-python\">https:\/\/github.com\/djc\/couchdb-python<\/a><\/li>\n\n\n<li>Java: <a href=\"https:\/\/github.com\/djc\/couchdb-python\">https:\/\/github.com\/helun\/Ektorp<\/a><\/li>\n\n<\/ul>\n\n\n\n<p>Out of all the <a href=\"https:\/\/docs.couchdb.org\/en\/latest\/api\/database\/changes.html\">parameters\u00a0available<\/a> in the query string, the most important ones in our case are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>feed=continuous to ensure that we get changes immediately<\/li>\n\n\n<li>since=now to get the changes from the current time, otherwise it will log all changes since the database was created!<\/li>\n\n<\/ul>\n\n\n\n<p>Finally, let\u2019s focus on the the last piece of the puzzle: given a document change from the changes feed, we need to get the user profile documents &#8220;<em>interested&#8221;<\/em> in that change because they hold the device tokens.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Changes Feed \u2192 GCM<\/h2>\n\n\n\n<p>In ToDoLite, there are 3 types of documents: a profile, a list and a task. The task document holds a reference to the list it belongs to and a list has an owner and a members array.<\/p>\n\n\n\n<p><img decoding=\"async\" src=\"https:\/\/cl.ly\/image\/1J3O1D1s131U\/Model.png\"><\/p>\n\n\n\n<p>When a task document or a list document changes we\u2019d like to notify the owner and members of that list. There are two types of events we\u2019d like to handle:<\/p>\n\n\n\n<p>1. A list document change event:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>get the profile document of the owner<\/li>\n\n\n<li>get the profile document for each member<\/li>\n\n<\/ul>\n\n\n\n<p>2. A task document change event:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>get the list document it belongs to<\/li>\n\n\n<li>follow the same steps as 1)<\/li>\n\n<\/ul>\n\n\n\n<p>With the device tokens retrieved, the last step is to send a request to Google Cloud Messaging servers with our API Key and notification payload. You can also find many libraries on GitHub that make it simple to interact with the GCM servers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>NodeJS: <a href=\"https:\/\/github.com\/ToothlessGear\/node-gcm\">https:\/\/github.com\/ToothlessGear\/node-gcm<\/a><\/li>\n\n\n<li>Go: <a href=\"https:\/\/github.com\/alexjlockwood\/gcm\">https:\/\/github.com\/alexjlockwood\/gcm<\/a><\/li>\n\n\n<li>Python: <a href=\"https:\/\/github.com\/geeknam\/python-gcm\">https:\/\/github.com\/geeknam\/python-gcm<\/a><\/li>\n\n\n<li>Java: <a href=\"https:\/\/github.com\/inloop\/easygcm\">https:\/\/github.com\/inloop\/easygcm<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Wrap up<\/h2>\n\n\n\n<p>Using Google Cloud Messaging to trigger data fetching from the server side can provide a great user experience without any additional battery and network usage overhead.<\/p>\n\n\n\n<p>Follow the <a href=\"https:\/\/github.com\/couchbaselabs\/ToDoLite-Android#syncing-with-google-cloud-messaging\">readme<\/a>\u00a0instructions to run the ToDoLite demo.<\/p>\n\n\n\n<p>I would love to know how you are using Google Cloud Messaging notifications in your app. Let me know in the comments below!<\/p>\n\n\n\n<p>More reading:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tips on setting up GCM in your app: <a href=\"https:\/\/blog.pushbullet.com\/2014\/02\/12\/keeping-google-cloud-messaging-for-android-working-reliably-techincal-post\/\">https:\/\/blog.pushbullet.com\/2014\/02\/12\/keeping-google-cloud-messaging-for-android-working-reliably-techincal-post\/<\/a><\/li>\n\n\n<li>Data sync in the Google I\/O app: <a href=\"https:\/\/android-developers.blogspot.co.uk\/2014\/09\/conference-data-sync-gcm-google-io.html\">https:\/\/android-developers.blogspot.co.uk\/2014\/09\/conference-data-sync-gcm-google-io.html<\/a><\/li>\n\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When developing an application, it\u2019s very helpful to use the push and pull replication in continuous mode. Everything is handled by the replicators to make sure your app and Sync Gateway always have the latest documents synced. However, a continuous pull replication means that Couchbase Lite will be using techniques such as long polling or [&hellip;]<\/p>\n","protected":false},"author":51,"featured_media":18,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[115],"class_list":["post-304","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Tutorial: Implement Android Push Notifications in your Couchbase Mobile app - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/ko\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app\" \/>\n<meta property=\"og:description\" content=\"When developing an application, it\u2019s very helpful to use the push and pull replication in continuous mode. Everything is handled by the replicators to make sure your app and Sync Gateway always have the latest documents synced. However, a continuous pull replication means that Couchbase Lite will be using techniques such as long polling or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-26T16:00:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"James Nocentini, Technical Writer, Mobile, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Nocentini, Technical Writer, Mobile, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/\"},\"author\":{\"name\":\"James Nocentini, Technical Writer, Mobile, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/ec4dfbd349cb4a321fb6a92b71a9a7f6\"},\"headline\":\"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app\",\"datePublished\":\"2015-04-26T16:00:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/\"},\"wordCount\":1104,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/\",\"name\":\"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-04-26T16:00:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/ec4dfbd349cb4a321fb6a92b71a9a7f6\",\"name\":\"James Nocentini, Technical Writer, Mobile, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g09977bdd14473dc23a125f2f74c3e816\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g\",\"caption\":\"James Nocentini, Technical Writer, Mobile, Couchbase\"},\"description\":\"James Nocentini is the Technical Writer in charge of the documentation for Couchbase Mobile. Previously, he worked as a Developer Advocate and before that as a front-end developer for HouseTrip. He also enjoys writing Android tutorials for raywenderlich.com in his spare time.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/ko\\\/author\\\/james-nocentini\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/ko\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/","og_locale":"ko_KR","og_type":"article","og_title":"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app","og_description":"When developing an application, it\u2019s very helpful to use the push and pull replication in continuous mode. Everything is handled by the replicators to make sure your app and Sync Gateway always have the latest documents synced. However, a continuous pull replication means that Couchbase Lite will be using techniques such as long polling or [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-04-26T16:00:41+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"James Nocentini, Technical Writer, Mobile, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"James Nocentini, Technical Writer, Mobile, Couchbase","Est. reading time":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/"},"author":{"name":"James Nocentini, Technical Writer, Mobile, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ec4dfbd349cb4a321fb6a92b71a9a7f6"},"headline":"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app","datePublished":"2015-04-26T16:00:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/"},"wordCount":1104,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","articleSection":["Uncategorized"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/","url":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/","name":"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","datePublished":"2015-04-26T16:00:41+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/tutorial-implement-android-push-notifications-in-your-couchbase-mobile-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tutorial: Implement Android Push Notifications in your Couchbase Mobile app"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/ec4dfbd349cb4a321fb6a92b71a9a7f6","name":"James Nocentini, Technical Writer, Mobile, Couchbase","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/secure.gravatar.com\/avatar\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g09977bdd14473dc23a125f2f74c3e816","url":"https:\/\/secure.gravatar.com\/avatar\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0aa80108e5c81e282d705199edae5a25f8ef92abf15cd64f8ff19837abcee09a?s=96&d=mm&r=g","caption":"James Nocentini, Technical Writer, Mobile, Couchbase"},"description":"James Nocentini is the Technical Writer in charge of the documentation for Couchbase Mobile. Previously, he worked as a Developer Advocate and before that as a front-end developer for HouseTrip. He also enjoys writing Android tutorials for raywenderlich.com in his spare time.","url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/james-nocentini\/"}]}},"acf":[],"authors":[{"term_id":115,"user_id":51,"is_guest":0,"slug":"james-nocentini","display_name":"James Nocentini, Technical Writer, Mobile, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=304"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/18"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=304"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}