Table of Contents

TTMSFNCCustomWebPushDB.AddSubscription Method

Adds a subscription identified only by its endpoint and keys, without user or browser identifiers.

API unit family: TMS.TMSFNCWebPushDB Declaring type: TTMSFNCCustomWebPushDB

Overloads

Overload 1

Adds a subscription identified only by its endpoint and keys, without user or browser identifiers.

procedure AddSubscription(ASubscription: TTMSFNCWebPushSubscription); overload;

Remarks

The record is added only when no row with the same endpoint already exists and the before-add event allows it.

Parameters

Name Description
ASubscription Subscription payload (endpoint, keys, optional user data) to store.

Overload 2

Adds a subscription associated with a specific user and browser.

procedure AddSubscription(AUserID, ABrowserID: string; ASubscription: TTMSFNCWebPushSubscription; AUserActive: Boolean = True); overload;

Remarks

The record is added only when no row with the same user and browser identifiers already exists. Identifier and optional columns are written only when their fields are active.

Parameters

Name Description
AUserID User identifier to store.
ABrowserID Browser or device identifier to store.
ASubscription Subscription payload (endpoint, keys, optional user data) to store.
AUserActive Initial active state for the user. True marks the user as active and eligible to receive messages. Defaults to True.