Agent Wranglers

Recommended Free service

Use Firebase Cloud Messaging for Android and Apple app push

Send push messages to installed Android and Apple apps through Firebase Cloud Messaging with the Firebase Admin SDK.

Cost

Free service. Google charges nothing to send, but the service is not open source. No open source service can reach these phones, because Android delivers through Google's servers and Apple only through APNs.

How to do it

The firebase-admin npm package reached 1.0.0 in July 2014, and 14.5.0 shipped on 23 September 2026. It had about 5.9 million weekly npm downloads in October 2026. The Python package reached 1.0.0 in April 2017, and had about 4.0 million weekly downloads. Both are Apache-2.0. One send call reaches Android and Apple clients through the FCM v1 API. Device tokens are your only stored state, so leaving means sending through APNs and the web push standard directly. Keep messages to Use the current APNs and FCM interfaces and Delete dead subscriptions and tokens at once. Choose something else when you only push to browsers. The Web Push standard above needs no Google account. Choose APNs directly when you ship only to Apple devices.

Examples

Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

JavaScript example

import { initializeApp } from 'firebase-admin/app';
import { getMessaging } from 'firebase-admin/messaging';

initializeApp();

export const notifyOrderShipped = (token, orderId) => getMessaging().send({
  token,
  notification: { title: 'Your order has shipped', body: `Order ${orderId} is on its way.` },
});

Python example

import firebase_admin
from firebase_admin import messaging

firebase_admin.initialize_app()

def notify_order_shipped(token: str, order_id: str) -> str:
    return messaging.send(messaging.Message(
        token=token,
        notification=messaging.Notification(title="Your order has shipped", body=f"Order {order_id} is on its way."),
    ))

How to check

Every send uses the Admin SDK or the FCM v1 endpoint, and the code has no legacy FCM server key. A send to an unregistered token deletes that token in a test.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/stack/product-services/fcm-push">Agent Wranglers software choices playbook</a>. In code you write, add a comment next to it with the same link.