Delphi Google Cloud SDK — FCM, Pub/Sub, Calendar & more

A coherent set of Pascal components for the Google Cloud platform: push mobile notifications with Firebase Cloud Messaging HTTP v1, pull / publish messages on Cloud Pub/Sub, schedule events on Google Calendar, sign service-account JWTs for any GCP service, and generate strongly-typed clients for any Google API from its discovery / OpenAPI document — all from sgcWebSockets.

Native components for every GCP surface

No Python google-cloud bindings, no Java JDK, no Node.js bridge — just Delphi components that speak HTTPS, HTTP/2 and OAuth2 directly to Google’s endpoints.

Google Cloud Platform exposes hundreds of REST APIs — messaging, storage, queueing, identity, mapping, machine learning, productivity (Calendar, Drive, Gmail, Docs), advertising, analytics, billing and more. Until now, calling them from Delphi meant hand-writing JWT signers, OAuth2 token refreshers, multipart uploaders and SSE parsers. sgcWebSockets ships first-class components for the most common surfaces — TsgcHTTP_API_GoogleFCM for Firebase Cloud Messaging HTTP v1, TsgcHTTP_API_GoogleCloudPubSub for Cloud Pub/Sub, TsgcHTTP_API_GoogleCalendar for the Calendar API v3 — plus reusable OAuth2 + service-account-JWT infrastructure that drives every other Google endpoint and the sgcOpenAPI code generator for the long tail.

Authentication is uniform: a Google Cloud project, a service account JSON key (or an OAuth2 client for end-user flows), and the appropriate https://www.googleapis.com/auth/... scopes. The library’s JWT signer builds the assertion, requests an access token from oauth2.googleapis.com/token, and caches / refreshes it transparently. The same code runs unmodified on Windows, macOS, Linux, iOS and Android, with both VCL and FMX UI layers.

Core components

TsgcHTTP_API_GoogleFCM, TsgcHTTP_API_GoogleCloudPubSub, TsgcHTTP_API_GoogleCalendar, TsgcOAuth2Client, TsgcJWTClient.

Transport

HTTPS / HTTP/2 with TLS 1.3, OAuth2 + service-account JWT (RS256), Bearer-token caching.

Platforms

Windows, macOS, Linux, iOS, Android, .NET.

Code generator

sgcOpenAPI consumes any Google discovery / OpenAPI document and emits Pascal client classes.

First-class wrappers + generated SDKs

Firebase Cloud Messaging (HTTP v1)

TsgcHTTP_API_GoogleFCM — send push notifications to Android, iOS and web clients with the modern OAuth2-based FCM HTTP v1 API. Topic / token / condition targeting, data payloads, image / sound / channel overrides.

Cloud Pub/Sub

TsgcHTTP_API_GoogleCloudPubSub — publish messages to topics, pull from subscriptions, ack / nack, batched send, push-style HTTP subscriptions with end-to-end signed envelopes.

Google Calendar API v3

TsgcHTTP_API_GoogleCalendar — list calendars, CRUD events, manage attendees, recurring rules, free/busy queries and ACLs — with OAuth2 user consent or service-account domain-wide delegation.

Google Cloud Storage

Upload / download objects, signed URLs, resumable uploads and bucket management via HTTPS — works with any GCS bucket and S3-compatible interop.

Google AI & Gemini

Native client for Gemini generative-language models, embeddings and Vertex AI — streaming over SSE, function calling, JSON-mode structured outputs.

Google Drive, Gmail, Sheets, Docs

Generated SDKs via sgcOpenAPI — OAuth2 + the appropriate Workspace scopes give you Pascal classes for every endpoint.

Google Maps Platform

Geocoding, directions, distance matrix, places and roads — HTTPS + API key or OAuth2.

Generated Google Cloud SDKs

sgcOpenAPI emits Pascal client classes for any Google REST API that publishes an OpenAPI document — Compute Engine, BigQuery, Cloud Functions, Cloud Run, Secret Manager and friends.

OAuth2 + service-account JWT, server-side

Most Google Cloud APIs accept two forms of credential: a service-account JSON key (RS256-signed JWT exchanged at oauth2.googleapis.com/token for a short-lived bearer token, no user interaction) and an OAuth2 client with the standard authorisation-code or device-code flow for end-user data (Calendar, Drive, Gmail). sgcWebSockets covers both: TsgcJWTClient signs the assertion, TsgcOAuth2Client drives the user flow, and the per-service components consume whichever credential you wire in. Tokens are cached in memory and refreshed before expiry so your application code never touches a 401.

Send an FCM push from Delphi

A 25-line snippet that authenticates with a service-account JSON key and pushes a notification to a single device token.

uses
  sgcHTTP_API_GoogleFCM, sgcHTTP_API_GoogleFCM_Types;

var
  vFCM:     TsgcHTTP_API_GoogleFCM;
  vMessage: TsgcGoogleFCMMessage;
begin
  vFCM := TsgcHTTP_API_GoogleFCM.Create(nil);
  try
    vFCM.ProjectId            := 'my-firebase-project';
    vFCM.ServiceAccountFile   := 'C:\keys\my-project-fcm.json';

    vMessage := TsgcGoogleFCMMessage.Create;
    try
      vMessage.Token             := 'eXampleDeviceTokenFromAndroidOrIOSClient...';
      vMessage.Notification.Title := 'New order';
      vMessage.Notification.Body  := 'Order #1234 has been confirmed.';
      vMessage.Data.AddPair('orderId', '1234');
      vMessage.Android.Priority   := fpHigh;

      vFCM.SendMessage(vMessage);
    finally
      vMessage.Free;
    end;
  finally
    vFCM.Free;
  end;
end;

Publish and pull messages

Cloud Pub/Sub is Google’s globally distributed, at-least-once messaging fabric — the backbone of countless event-driven architectures. The same service account credential drives both ends; publishers POST messages to a topic, subscribers either pull on a schedule or accept push deliveries on an HTTPS endpoint.

uses
  sgcHTTP_API_GoogleCloudPubSub;

var
  vPubSub: TsgcHTTP_API_GoogleCloudPubSub;
begin
  vPubSub := TsgcHTTP_API_GoogleCloudPubSub.Create(nil);
  try
    vPubSub.ProjectId          := 'my-project';
    vPubSub.ServiceAccountFile := 'C:\keys\my-project-pubsub.json';

    // Publish
    vPubSub.Publish('orders', '{"orderId":1234,"total":42.50}');

    // Pull
    vPubSub.OnMessageReceived := DoMessageReceived;
    vPubSub.Subscribe('orders-worker');  // long-running pull loop
  finally
    vPubSub.Free;
  end;
end;

Three steps to your first GCP call

1. Install

Drop sgcWebSockets into your Delphi or C++Builder IDE — one package per Delphi version 7 through 13. Download the trial.

2. Create a service account

In the Google Cloud console, create a service account, grant it the right roles (e.g. Pub/Sub Publisher, Firebase Messaging Admin), and download the JSON key.

3. Drop a component

For FCM use TsgcHTTP_API_GoogleFCM, for Pub/Sub use TsgcHTTP_API_GoogleCloudPubSub, for Calendar use TsgcHTTP_API_GoogleCalendar — or generate a custom SDK with sgcOpenAPI.

Delphi Google Cloud SDK

Overview of how sgcWebSockets exposes the Google Cloud surface to Pascal developers.

Firebase Cloud Messaging HTTP v1 in Delphi

Step-by-step walk-through of the modern FCM API and how it replaces the legacy server key.

Google Cloud Pub/Sub Delphi component

Publish, pull and acknowledge messages with the Pub/Sub component.

Google Calendar API v3

Create and update events from a VCL or FMX application.

Google API key + OAuth2

When to use an API key vs OAuth2 vs service-account credentials.

Ship Google Cloud integrations in your Delphi app today

Download the trial — FCM, Pub/Sub and Calendar demos ship ready to compile.