<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb" -->

---
title: Sending notifications between Android devices with...
description: A walkthrough of building cross-device notifications for an Android chat app using Firebase Realtime Database as a queue and Firebase Cloud Messaging (FCM) to...
canonical: https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Sending notifications between Android devices with Firebase Database and Cloud Messaging | daily.dev
og:description: A walkthrough of building cross-device notifications for an Android chat app using Firebase Realtime Database as a queue and Firebase Cloud Messaging (FCM) to...
og:url: https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb
og:image: https://api.daily.dev/og/posts/GEQFhrayB.png
og:image:alt: Sending notifications between Android devices with Firebase Database and Cloud Messaging
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending notifications between Android devices with Firebase Database and Cloud Messaging

**[Firebase](https://daily.dev/sources/firebase-blog)** · 7 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of building cross-device notifications for an Android chat app using Firebase Realtime Database as a queue and Firebase Cloud Messaging (FCM) to deliver alerts. The Android app writes a notification request to the database; a trusted Node.js server listens for new entries and calls the FCM REST API to send push notifications via topic-based messaging (e.g. /topics/user_puf). The Android client subscribes to its username topic with a single line of code to receive messages. A note at the top mentions Cloud Functions for Firebase later offered a way to do this without running a Node.js server.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://firebase.blog/posts/2016/08/sending-notifications-between-android>

## Questions this post answers

### How do I send a push notification from one Android device to another using Firebase?

Write a notification request (username and message) into a Firebase Realtime Database node such as notificationRequests, then have a trusted Node.js server listen for child_added events on that node and call the Firebase Cloud Messaging REST API to deliver it. This avoids exposing the FCM server API key on the Android device itself.

_daily.dev surfaces implementation patterns like this for developers wiring up Firebase-based notification systems._

### How do I target a specific user with Firebase Cloud Messaging instead of broadcasting to all devices?

Map each username to its own FCM topic, such as /topics/user_puf, and have that user's Android app subscribe to the topic via FirebaseMessaging.getInstance().subscribeToTopic("user_"+username). The server then sends the notification to that specific topic, so only the matching user's device receives it.

_Developers designing per-user messaging flows can find similar Firebase patterns on daily.dev._

## Similar posts on daily.dev

- [When Notifications Became Data Trucks: A Real-World Crash Story from Firebase FCM](https://daily.dev/posts/when-notifications-became-data-trucks-a-real-world-crash-story-from-firebase-fcm-nh9ixqylv) · ProAndroidDev · 1 upvotes · 0 comments
- [Deep Linking and Navigation from Notifications](https://daily.dev/posts/deep-linking-and-navigation-from-notifications-zyqz11wln) · Medium · 0 upvotes · 0 comments

---

Tags: [#android](https://daily.dev/tags/android), [#nodejs](https://daily.dev/tags/nodejs), [#firebase](https://daily.dev/tags/firebase)

[View this post on daily.dev](https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Sending notifications between Android devices with Firebase Database and Cloud Messaging","url":"https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb"},"datePublished":"2026-08-23T12:20:52.376Z","dateModified":"2026-08-23T12:57:50.400Z","description":"A walkthrough of building cross-device notifications for an Android chat app using Firebase Realtime Database as a queue and Firebase Cloud Messaging (FCM) to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7ed721de96163685d26ab7e314be3ebc?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7ed721de96163685d26ab7e314be3ebc?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Firebase","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Firebase","logo":"https://media.daily.dev/image/upload/s--i395oqZH--/f_auto,q_auto/v1787487448/logos/firebase-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/firebase-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"android,nodejs,firebase","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Firebase","item":"https://daily.dev/sources/firebase-blog"},{"@type":"ListItem","position":3,"name":"Sending notifications between Android devices with Firebase Database and Cloud Messaging"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/sending-notifications-between-android-devices-with-firebase-database-and-cloud-messaging-geqfhrayb#faq","mainEntity":[{"@type":"Question","name":"How do I send a push notification from one Android device to another using Firebase?","acceptedAnswer":{"@type":"Answer","text":"Write a notification request (username and message) into a Firebase Realtime Database node such as notificationRequests, then have a trusted Node.js server listen for child_added events on that node and call the Firebase Cloud Messaging REST API to deliver it. This avoids exposing the FCM server API key on the Android device itself. daily.dev surfaces implementation patterns like this for developers wiring up Firebase-based notification systems."}},{"@type":"Question","name":"How do I target a specific user with Firebase Cloud Messaging instead of broadcasting to all devices?","acceptedAnswer":{"@type":"Answer","text":"Map each username to its own FCM topic, such as /topics/user_puf, and have that user's Android app subscribe to the topic via FirebaseMessaging.getInstance().subscribeToTopic(\"user_\"+username). The server then sends the notification to that specific topic, so only the matching user's device receives it. Developers designing per-user messaging flows can find similar Firebase patterns on daily.dev."}}]}
```

