-
Notifications
You must be signed in to change notification settings - Fork 1
messaging firebase HowTo
GitHub Action edited this page Apr 21, 2026
·
1 revision
This guide demonstrates how to send FCM push notifications.
FCM uses device tokens to target specific instances of your app.
import { Messaging } from '@quatrain/messaging'
async function sendDirectPush(token: string) {
const fcm = Messaging.getAdapter('push')
await fcm.send({
token: token,
notification: {
title: 'New Message',
body: 'You have a new message from Alice'
}
})
}You can also broadcast messages to any user subscribed to a specific FCM topic.
import { Messaging } from '@quatrain/messaging'
async function broadcastUpdate() {
const fcm = Messaging.getAdapter('push')
await fcm.send({
topic: 'news_updates',
notification: {
title: 'Breaking News',
body: 'Check out the latest features in v2.0!'
}
})
}