Table of Contents

TTMSFNCWebPushSender Class

Component that sends web push notifications to subscribed clients. Drop it on a form or data module, assign the authentication settings, claims, and subscription store, then call one of the send methods to deliver a notification to a single recipient, a specific user, or all subscribers.

API unit family: TMS.TMSFNCWebPushSender Inherits from: TTMSFNCCustomWebPushSender

Syntax

TTMSFNCWebPushSender = class(TTMSFNCCustomWebPushSender)

Properties

Name Description
Claims Claims embedded in the signed authentication token, such as the contact subject and the token expiration window. (inherited from TTMSFNCCustomWebPushSender)
PushDB Subscription store that supplies recipient endpoints for the send-by-id and send-to-all methods, and from which failed subscriptions are removed. (inherited from TTMSFNCCustomWebPushSender)
VapidSettings Authentication key pair and related settings used to sign each push request. The keys are initialized automatically before the first request when not already loaded. (inherited from TTMSFNCCustomWebPushSender)

Methods

Name Description
SendNotification Sends a raw JSON payload to a single subscription with default delivery options. (inherited from TTMSFNCCustomWebPushSender)
SendNotificationAll Sends a raw JSON payload to every active subscription in the store using default delivery options. Requires an assigned subscription store. (inherited from TTMSFNCCustomWebPushSender)
SendNotificationById Sends a raw JSON payload to every active subscription of a user using default delivery options. Requires an assigned subscription store. (inherited from TTMSFNCCustomWebPushSender)

Events

Name Description
OnBeforeSendNotification Occurs before each notification is sent, allowing the handler to cancel delivery to a specific recipient. (inherited from TTMSFNCCustomWebPushSender)
OnCreateIOHandler Occurs when a transport handler is needed, allowing the handler to supply a custom secure transport. (inherited from TTMSFNCCustomWebPushSender)
OnNotificationError Occurs when the push service rejects a notification, allowing the handler to decide whether the failed subscription is removed. (inherited from TTMSFNCCustomWebPushSender)
OnNotificationSent Occurs after the push service accepts a notification for a recipient. (inherited from TTMSFNCCustomWebPushSender)