Table of Contents

Getting started with TMS FNC Web Push DB

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Push Notifications package referenced in the project.
  • A TDataSource component wired to a dataset (e.g. TFDMemTable, TClientDataSet).

Add and configure the store

  1. Drop TTMSFNCWebPushDB onto a form or data module.
  2. Assign your TDataSource to DataSource.
  3. Map dataset field names to subscription fields via the Fields property.
{ Inside your form's OnCreate event: }
WebPushDB1.DataSource := DataSource1;
{ Map field names to subscription columns }
WebPushDB1.Fields.EndpointField := 'Endpoint';
WebPushDB1.Fields.AuthField := 'Auth';
WebPushDB1.Fields.P256DHField := 'P256DH';

Add a subscription manually

{ Illustrative — ASubscription is typically supplied by TTMSFNCWebPushServer }
WebPushDB1.AddSubscription(ASubscription);

React to subscription events

procedure TForm1.WebPushDB1OnSubscriptionAdded(
  Sender: TObject; ASubscription: TTMSFNCWebPushSubscription);
begin
  { A new subscription has been persisted to the dataset }
end;

Next steps

  • Guides — dataset wiring, field mapping, subscription lifecycle.
  • API reference — full class reference.