diff --git a/src/@awesome-cordova-plugins/plugins/clevertap/index.ts b/src/@awesome-cordova-plugins/plugins/clevertap/index.ts index f2a26e8b9..1497aff21 100644 --- a/src/@awesome-cordova-plugins/plugins/clevertap/index.ts +++ b/src/@awesome-cordova-plugins/plugins/clevertap/index.ts @@ -62,14 +62,37 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } - /** - * Enables tracking opt out for the currently active user. - * - * @param optOut {boolean} - * @returns {Promise} - */ +/** +* Sets the user's consent for event and profile tracking. +* +* You must call this method separately for each active user profile, +* for example, when switching user profiles using `onUserLogin`. +* +* Consent Scenarios: +* +* 1. **Complete Opt-Out** +* `userOptOut = true`, `allowSystemEvents = false` +* → No events (custom or system) are saved locally or remotely. Maximum privacy. +* +* 2. **Full Opt-In** +* `userOptOut = false`, `allowSystemEvents = true` +* → All events (custom and system) are tracked. Default behavior. +* +* 3. **Partial Opt-In** +* `userOptOut = true`, `allowSystemEvents = true` +* → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored. +* +* ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid. +* In such cases, the SDK defaults to **Full Opt-In**. +* +* To re-enable full tracking after opting out, call with: +* `userOptOut = false`, `allowSystemEvents = true`. +* +* @param {boolean} userOptOut - Set to `true` to disable custom event tracking. +* @param {boolean} allowSystemEvents - Set to `true` to allow system-level event tracking. +*/ @Cordova() - setOptOut(optOut: boolean): Promise { + setOptOut(optOut: boolean, allowSystemEvents?: boolean): Promise { return; } @@ -131,24 +154,14 @@ export class CleverTap extends AwesomeCordovaNativePlugin { } /** - * Sets the device's Baidu push token + * Sets the devices push token for providers other than FCM * * @param token {string} + * @param pushType {object} - with the following keys "type", "prefKey", "className", "messagingSDKClassName"; * @returns {Promise} */ @Cordova() - setPushBaiduToken(token: string): Promise { - return; - } - - /** - * Sets the device's Huawei push token - * - * @param token {string} - * @returns {Promise} - */ - @Cordova() - setPushHuaweiToken(token: string): Promise { + registerPushToken(token: string, pushType: any): Promise { return; }