Skip to content

Commit cc1bb19

Browse files
Anush-ShandpwilknissdanielsogldarshanclevertapSuryaClevertap
authored
feat(clevertap): support clevertap-cordova 4.2.0 (#4938)
* feat(clevertap): add CleverTap plugin * style(clevertap): cleanup stray lint error * refactor * feat(clevertap): update for latest CleverTap Cordova plugin * chore: Update Repo from Ionic Native Repo * fix: Code Changes for parity SDK-155 * fix: Indentation fixes for SDK-155 * fix: Code Repo fix while updating fork branch * fix: Remove unnecessary adder .scripts Folder * fix: Remove unwanted added folder .circleci * fix: Remove unwanted added File .npmrc * fix: Revert .Github Folder Changes to as per Ionic-Native master * fix: Update changes as per ionic-native master * fix: Code Repo fix while updating fork branch fix: Remove unnecessary adder .scripts Folder fix: Remove unwanted added folder .circleci fix: Remove unwanted added File .npmrc fix: Revert .Github Folder Changes to as per Ionic-Native master fix: Update changes as per ionic-native master * fix(CleverTap): Fix for missing methods issue #3491 * refactor(profile): remove setProfile methods for fb and google * refactor(dynamic variables): remove Product A/B Testing (Dynamic Variables) code * fix(product config): add key param to product config getters * feat(identity): add a new public method getCleverTapID and deprecate existing CleverTapID methods * feat(profile): add public methods to increment/decrement values set via User properties * feat(profile): add public methods to increment/decrement values set via User properties * feat(inapp): add public methods for suspending/discarding & resuming InApp Notifications * feat(inbox): add new api for iOS to delete bulk inbox messages for given message ids * refactor(xiaomi-push): add region as an extra mandatory parameter to setPushXiaomiToken * Update index.ts to support cordova 2.7.0 * Update index.ts * feat(clevertap): support clevertap-cordova 2.7.2 * feat(clevertap): support clevertap-cordova 2.7.2 * feat(clevertap): support clevertap-cordova 2.7.2 * task(SDK-3757) - Add support for cordova v3.0.0 - Adds 2 new APIs = clearInAppResources() and fetchInApps() * task(SDK-3757) - Add support for cordova v3.2.0 - Removes xiaomi related APIs * task(SDK-4148) - Add support for cordova v3.3.0 - Custom Templates - File Variables * task(SDK-4386) - Add support for cordova v3.4.0 - Multi Triggers - Deprecates older APIs * task(SDK-4625) - Support clevertap-cordova 4.0.0 * task(SDK-4625) - Removes baidu and huawei APIs * task(SDK-5073) - Support cordova v4.2.0 --------- Co-authored-by: Peter Wilkniss <[email protected]> Co-authored-by: Daniel Sogl <[email protected]> Co-authored-by: Darshan Pania <[email protected]> Co-authored-by: Surya <[email protected]> Co-authored-by: SuryaClevertap <[email protected]> Co-authored-by: Piyush Kukadiya <[email protected]> Co-authored-by: piyush-kukadiya <[email protected]> Co-authored-by: AishwaryaNanna <[email protected]>
1 parent 2a56831 commit cc1bb19

File tree

1 file changed

+34
-21
lines changed
  • src/@awesome-cordova-plugins/plugins/clevertap

1 file changed

+34
-21
lines changed

src/@awesome-cordova-plugins/plugins/clevertap/index.ts

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,37 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
6262
return;
6363
}
6464

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> {
7396
return;
7497
}
7598

@@ -131,24 +154,14 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
131154
}
132155

133156
/**
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
146158
*
147159
* @param token {string}
160+
* @param pushType {object} - with the following keys "type", "prefKey", "className", "messagingSDKClassName";
148161
* @returns {Promise<any>}
149162
*/
150163
@Cordova()
151-
setPushHuaweiToken(token: string): Promise<any> {
164+
registerPushToken(token: string, pushType: any): Promise<any> {
152165
return;
153166
}
154167

0 commit comments

Comments
 (0)