Docs

Push notifications

Send push notifications to your app users through FCM and APNs with your own credentials: register tokens from the app, send from a function or your server.

Updated Oct 17, 2026Open in console
  1. Add credentials

    Console › Authentication › Mobile › Push notifications: upload the Firebase service account JSON (Android, and iOS through Firebase) and/or an APNs .p8 key (key id, team id, bundle id, sandbox or production). They are encrypted and never shown again.

  2. Register the token after sign-in

    final token = await FirebaseMessaging.instance.getToken();
    await sovaria.push.register(token: token!, platform: Platform.isIOS ? 'ios' : 'android', topics: ['news']);
    FirebaseMessaging.instance.onTokenRefresh.listen((t) => sovaria.push.register(token: t, platform: 'android'));
  3. Send from a function

    // Functions › Secrets: SOVARIA_SERVICE_ROLE_KEY
    await sov.api.push.send({ message: {
      to: { user_ids: [order.user_id] },                // or device_ids, or topic: 'news'
      notification: { title: 'Order shipped', body: 'Arriving tomorrow' },
      data: { order_id: order.id },
    } })
FieldMeaning
touser_ids, device_ids and/or topic (devices subscribed with push.subscribe).
notificationtitle, body, image (https).
dataString key/values your app receives.
badge, sound, thread_id, android_channel_idPlatform extras.
priority, ttl_seconds, collapse_keyhigh (default) or normal; how long to keep trying; replace an older push with the same key.
content_availableSilent push that wakes the app (sent with APNs priority 5).
dry_runCount the audience; nothing is sent and nothing is billed.
  • App users can only register and remove their own tokens; only console admins and server keys send.
  • Tokens a provider reports as gone (uninstalled app) are disabled automatically.
  • Each send is logged with counts and error codes — never the message content (Push notifications › Recent sends).
  • Limits: push.sends_month (Free stops at the cap, paid plans bill overage), push.max_recipients_per_send, push.sends_per_second, push.devices_per_user.
Something unclear or missing on this page?Tell us