Guides

Push

Firebase Cloud Messaging from ctx.push.send. Android, iOS, and web via Firebase.

Open /projects/:id/push and paste a Firebase service-account JSON (encrypted). Optionally store a web VAPID key. Call ctx.push.send({ token or tokens, title, body, data? }). Device tokens live in your own tables. Native APNs without Firebase is not supported.

  • Create a Firebase project and enable Cloud Messaging.
  • Android: add google-services.json to the mobile app.
  • iOS: upload an APNs key to Firebase, not to Robodev.
  • Web: use firebaseConfig, request permission, send the FCM token to your API.

api/notify.ts

import { defineApi, z } from "@robodev-ai/sdk";
export const post = defineApi({
body: z.object({ token: z.string(), title: z.string(), body: z.string() }),
handler: async ({ push, body }) => push.send(body),
});