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
Drop TTMSFNCWebPushServer onto a form or data module.
Set DefaultHTTPPort (default 80) or DefaultHTTPSPort (default 443) to the port your server should listen on.
Assign a TTMSFNCWebPushDB instance to PushDB so the server can persist incoming subscriptions.
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;