TsgcWSAPIServer_WebPushEvents › OnWebPushUnsubscription

OnWebPushUnsubscription Event

Fires when a browser POSTs to the Unsubscription endpoint (PushManager.unsubscribe() or service-worker change); use it to remove the subscription from your persistent store.

Syntax

public event TsgcWSWebPushUnsubscriptionHandler OnWebPushUnsubscription;
// delegate void TsgcWSWebPushUnsubscriptionHandler(TObject Sender, TsgcHTTP_API_WebPush_PushSubscription aSubscription, out int ResponseCode)

Default Value

Remarks

The internal Subscriptions list is automatically updated via Subscriptions.RemoveSubscription, so BroadcastNotification no longer targets the unsubscribed endpoint. Mirror the deletion on your own storage so stale records are not retained. Set ResponseCode to the HTTP status sent back to the browser — normally 200 on success.

Example

Back to Events