Table of Contents

Getting started with TMS FNC Web Push Server

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Push Notifications package referenced in the project.

Add and configure the server

  1. Drop TTMSFNCWebPushServer onto a form or data module.
  2. Set DefaultHTTPPort (default 80) or DefaultHTTPSPort (default 443) to the port your server should listen on.
  3. Assign a TTMSFNCWebPushDB instance to PushDB so the server can persist incoming subscriptions.
  4. Populate VAPIDSettings with the VAPID key pair generated for your application.
{ Inside your form's OnCreate event: }
WebPushServer1.DefaultHTTPPort := 8080;
WebPushServer1.PushDB := WebPushDB1;
{ Set VAPID keys via VAPIDSettings before activating }
WebPushServer1.Active := True;

React to subscription events

procedure TForm1.WebPushServer1OnRegisterSubscription(
  Sender: TObject; ASubscription: TTMSFNCWebPushSubscription);
begin
  { A browser has registered — the subscription is already stored in PushDB }
end;

Next steps

  • Guides — SSL configuration, subscription event handling, VAPID setup.
  • API reference — full class reference.