TsgcWSAPIServer_WebPushMethods › BroadcastNotification

BroadcastNotification Method

Sends the same notification to every subscription currently held in the internal Subscriptions list.

Overloads

Overload 1

Syntax

public void BroadcastNotification(TsgcWebPushMessage aMessage);

Parameters

NameTypeDescription
aMessageconst TsgcWebPushMessageStructured notification (Title/Body/Icon/Url) serialized once via AsJSON and reused for each subscription.

Remarks

Iterates the thread-safe Subscriptions list under a lock and calls SendNotification for each entry. If a send fails, OnWebPushSendNotificationException fires and, when Remove is returned True (the default), the subscription is automatically dropped from the list — ideal for cleaning up 404/410 responses from the push service.

Example

Overload 2

Syntax

public void BroadcastNotification(string aMessage);

Parameters

NameTypeDescription
aMessageconst stringRaw payload (usually JSON) delivered verbatim to every subscriber after per-subscription encryption.

Remarks

Convenience overload when the broadcast payload is already serialized. You can add or remove subscriptions manually through Subscriptions.AddSubscription/Subscriptions.RemoveSubscription if you manage persistence yourself.

Example

Back to Methods