Firebase Cloud Messaging (FCM)

Send Firebase Cloud Messaging V1 push notifications from Delphi. Service-account JWT signing, OAuth 2.0 token exchange and typed FCM message construction in one component.

TsgcHTTPGoogleCloud_FCM_Client

FCM HTTP V1 client — loads your Google service-account JSON, signs an RS256 JWT, exchanges it for an OAuth Access Token and POSTs the FCM message to fcm.googleapis.com/v1/projects/<id>/messages:send.

Komponentenklasse

TsgcHTTPGoogleCloud_FCM_Client

Plattformen

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Load Service-Account, send push

Load your Firebase service-account JSON, setze the project id, then call SendMessage mit dem FCM payload (token / topic / condition).

uses
  sgcHTTP;

var
  FCM: TsgcHTTPGoogleCloud_FCM_Client;
begin
  FCM := TsgcHTTPGoogleCloud_FCM_Client.Create(nil);
  FCM.GoogleCloudOptions.ServiceAccountJSON.LoadFromFile('service-account.json');

  FCM.SendMessage(
    'fcm-device-token-here',
    'Hello from Delphi',
    'This is a test FCM push');
end;
// uses: sgcHTTP
TsgcHTTPGoogleCloud_FCM_Client *FCM = new TsgcHTTPGoogleCloud_FCM_Client(this);
FCM->GoogleCloudOptions->ServiceAccountJSON->LoadFromFile("service-account.json");

FCM->SendMessage(
  "fcm-device-token-here",
  "Hello from Delphi",
  "This is a test FCM push");

Was steckt drin

Targets the FCM HTTP v1 endpoint — the legacy fcm.googleapis.com/fcm/send endpoint was deprecated by Google.

Service-account auth

Loads the standard Firebase service-account JSON, signs an RS256 JWT mit dem contained private key, then exchanges it at oauth2.googleapis.com/token for an Access Token.

Send to token / topic / condition

SendMessage overloads accept a registration token, a topic name (/topics/news) or a topic condition expression. SendBroadcast targets a topic for fan-out.

Notification + data payloads

Both the notification object (title/body/image) und die free-form data dictionary are exposed, including platform-specific overrides (Android android, iOS apns, Web webpush).

Token caching

Access tokens are cached and refreshed only wenn expired, so high-volume senders don't hammer the OAuth endpoint.

HTTP transport

Uses the project's standard HTTP client — pair with proxies, TLS settings and rate limiters as you would any other HTTP request.

Errors typed

OnSendError reports HTTP and FCM-specific errors (unregistered token, invalid argument, quota exceeded) so du kannst prune dead tokens or back off.

Spezifikationen und Referenzen

Maßgebliche Quellen für die API, die diese Komponente implementiert.

Dokumentation & Demos

Springe direkt zur Komponentenreferenz, lade das einsatzbereite Demo-Projekt herunter und teste die Testversion.

Online-Hilfe — FCM Client Vollständige Eigenschaften-, Methoden- und Ereignisreferenz für diese Komponente.
Demo Project — Demos\20.HTTP_Protocol\03.Google Einsatzbereites Beispielprojekt. Im sgcWebSockets-Paket enthalten — lade unten die Testversion herunter.
Technisches Dokument (PDF) Funktionen, Schnellstart, Codebeispiele für Delphi & C++ Builder und Primärquellenreferenzen — nur für diese Komponente.
Benutzerhandbuch (PDF) Umfassendes Handbuch zu jeder Komponente der Bibliothek.

Ready to Send FCM Pushes from Delphi?

Download the free trial and integrate Firebase Cloud Messaging into your Delphi applications.