@@ -62,14 +62,37 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
62
62
return ;
63
63
}
64
64
65
- /**
66
- * Enables tracking opt out for the currently active user.
67
- *
68
- * @param optOut {boolean}
69
- * @returns {Promise<any> }
70
- */
71
- @Cordova ( )
72
- setOptOut ( optOut : boolean ) : Promise < any > {
65
+ /**
66
+ * Sets the user's consent for event and profile tracking.
67
+ *
68
+ * You must call this method separately for each active user profile,
69
+ * for example, when switching user profiles using `onUserLogin`.
70
+ *
71
+ * Consent Scenarios:
72
+ *
73
+ * 1. **Complete Opt-Out**
74
+ * `userOptOut = true`, `allowSystemEvents = false`
75
+ * → No events (custom or system) are saved locally or remotely. Maximum privacy.
76
+ *
77
+ * 2. **Full Opt-In**
78
+ * `userOptOut = false`, `allowSystemEvents = true`
79
+ * → All events (custom and system) are tracked. Default behavior.
80
+ *
81
+ * 3. **Partial Opt-In**
82
+ * `userOptOut = true`, `allowSystemEvents = true`
83
+ * → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored.
84
+ *
85
+ * ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid.
86
+ * In such cases, the SDK defaults to **Full Opt-In**.
87
+ *
88
+ * To re-enable full tracking after opting out, call with:
89
+ * `userOptOut = false`, `allowSystemEvents = true`.
90
+ *
91
+ * @param {boolean } userOptOut - Set to `true` to disable custom event tracking.
92
+ * @param {boolean } allowSystemEvents - Set to `true` to allow system-level event tracking.
93
+ */
94
+ @Cordova ( )
95
+ setOptOut ( optOut : boolean , allowSystemEvents ?: boolean ) : Promise < any > {
73
96
return ;
74
97
}
75
98
@@ -131,24 +154,14 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
131
154
}
132
155
133
156
/**
134
- * Sets the device's Baidu push token
135
- *
136
- * @param token {string}
137
- * @returns {Promise<any> }
138
- */
139
- @Cordova ( )
140
- setPushBaiduToken ( token : string ) : Promise < any > {
141
- return ;
142
- }
143
-
144
- /**
145
- * Sets the device's Huawei push token
157
+ * Sets the devices push token for providers other than FCM
146
158
*
147
159
* @param token {string}
160
+ * @param pushType {object} - with the following keys "type", "prefKey", "className", "messagingSDKClassName";
148
161
* @returns {Promise<any> }
149
162
*/
150
163
@Cordova ( )
151
- setPushHuaweiToken ( token : string ) : Promise < any > {
164
+ registerPushToken ( token : string , pushType : any ) : Promise < any > {
152
165
return ;
153
166
}
154
167
0 commit comments