Getting started with TMS FNC Web Push Sender
Prerequisites
- TMS FNC Core installed and the runtime package added to the project.
- TMS FNC Push Notifications package referenced in the project.
- A populated
TTMSFNCWebPushDB with at least one active subscription.
- Drop
TTMSFNCWebPushSender onto a form or data module.
- Assign a
TTMSFNCWebPushDB instance to PushDB so the sender can read stored subscriptions.
- Populate
VAPIDSettings with the same VAPID key pair used by the server.
{ Inside your form's OnCreate event: }
WebPushSender1.PushDB := WebPushDB1;
{ Set VAPID keys via VAPIDSettings before sending }
Send a notification to all subscribers
{ Build a notification and broadcast to every subscription in PushDB }
WebPushSender1.SendNotificationAll(WebPushSender1.Notification);
React to delivery outcomes
procedure TForm1.WebPushSender1OnNotificationSent(
Sender: TObject; ASubscription: TTMSFNCWebPushSubscription);
begin
{ Notification was accepted by the push service }
end;
procedure TForm1.WebPushSender1OnNotificationError(
Sender: TObject; ASubscription: TTMSFNCWebPushSubscription;
AError: string);
begin
{ Delivery failed — inspect AError }
end;
Next steps
- Guides — notification payloads, VAPID authentication, error handling.
- API reference — full class reference.