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
Drop TTMSFNCWebPushDB onto a form or data module.
Assign your TDataSource to DataSource.
Map dataset field names to subscription fields via the Fields property.
Add and configure the storePascalC++
{ Inside your form's OnCreate event: }
WebPushDB1.DataSource := DataSource1;
{ Map field names to subscription columns }
WebPushDB1.Fields.EndPoint := 'Endpoint';
WebPushDB1.Fields.KeyAuth := 'Auth';
WebPushDB1.Fields.KeyP256dh := 'P256DH';
// Inside your form's OnCreate event:
WebPushDB1->DataSource = DataSource1;
// Map field names to subscription columns
WebPushDB1->Fields->EndPoint = "Endpoint";
WebPushDB1->Fields->KeyAuth = "Auth";
WebPushDB1->Fields->KeyP256dh = "P256DH";
Add a subscription manually
Add a subscription manuallyPascalC++
{ Illustrative — ASubscription is typically supplied by TTMSFNCWebPushServer }
WebPushDB1.AddSubscription(ASubscription);
// Illustrative - ASubscription is typically supplied by TTMSFNCWebPushServer
WebPushDB1->AddSubscription(ASubscription);
React to subscription events
React to subscription eventsPascalC++
procedure TForm1.WebPushDB1OnSubscriptionAdded(
Sender: TObject; ASubscription: TTMSFNCWebPushSubscription);
begin
{ A new subscription has been persisted to the dataset }
end;
void __fastcall TForm1::WebPushDB1OnSubscriptionAdded(TObject *Sender,
const TTMSFNCWebPushSubscription &ASubscription, System::UnicodeString AUserID,
System::UnicodeString ABrowserID)
{
// A new subscription has been persisted to the dataset
}
Next steps
Guides — dataset wiring, field mapping, subscription lifecycle.