From 24c61a50a76cc174245624ea71f21bf0f556a317 Mon Sep 17 00:00:00 2001 From: piyush-kukadiya <61137760+piyush-kukadiya@users.noreply.github.com> Date: Tue, 1 Feb 2022 15:00:12 +0530 Subject: [PATCH] feat(clevertap): support new clevertap changes (#4011) * 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 Co-authored-by: Peter Wilkniss Co-authored-by: Daniel Sogl Co-authored-by: Darshan Pania Co-authored-by: Surya Co-authored-by: SuryaClevertap <63039490+SuryaClevertap@users.noreply.github.com> --- .../plugins/clevertap/index.ts | 391 ++++-------------- 1 file changed, 78 insertions(+), 313 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/clevertap/index.ts b/src/@awesome-cordova-plugins/plugins/clevertap/index.ts index 897a1960ef..1ba0233d0d 100644 --- a/src/@awesome-cordova-plugins/plugins/clevertap/index.ts +++ b/src/@awesome-cordova-plugins/plugins/clevertap/index.ts @@ -474,28 +474,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } - /** - * Set profile attributes from facebook user - * - * @param profile {any} facebook graph user object - * @returns {Promise} - */ - @Cordova() - profileSetGraphUser(profile: any): Promise { - return; - } - - /** - * Set profile attributes rom google plus user - * - * @param profile {any} google plus user object - * @returns {Promise} - */ - @Cordova() - profileGooglePlusUser(profile: any): Promise { - return; - } - /** * Get User Profile Property * @@ -509,6 +487,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { } /** + * @deprecated This method is deprecated. Use getCleverTapID() instead. * Get a unique CleverTap identifier suitable for use with install attribution providers. * calls back with unique CleverTap attribution identifier * @@ -520,6 +499,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { } /** + * @deprecated This method is deprecated. Use getCleverTapID() instead. * Get User Profile CleverTapID * calls back with CleverTapID or false * @@ -530,6 +510,17 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } + /** + * Get User Profile CleverTapID + * calls back with CleverTapID + * + * @returns {Promise} + */ + @Cordova() + getCleverTapID(): Promise { + return; + } + /** * Remove the property specified by key from the user profile * @@ -601,6 +592,66 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } + /** + * Method for incrementing a value for a single-value profile property (if it exists). + * + * @param key {string} + * @param value {number} + * @returns {Promise} + */ + @Cordova() + profileIncrementValueBy(key: string,value: number): Promise { + return; + } + + /** + * Method for decrementing a value for a single-value profile property (if it exists). + * + * @param key {string} + * @param value {number} + * @returns {Promise} + */ + @Cordova() + profileDecrementValueBy(key: string,value: number): Promise { + return; + } + + /******************* + * In-App Controls + ******************/ + + /** + * Suspends and saves inApp notifications until 'resumeInAppNotifications' is called for current session. + * Automatically resumes InApp notifications display on CleverTap shared instance creation. + * Pending inApp notifications are displayed only for current session. + * + * @returns {Promise} + */ + @Cordova() + suspendInAppNotifications(): Promise { + return; + } + + /** + * Discards inApp notifications until 'resumeInAppNotifications' is called for current session. + * Automatically resumes InApp notifications display on CleverTap shared instance creation. + * Pending inApp notifications are not displayed. + */ + @Cordova() + discardInAppNotifications(): Promise { + return; + } + + /** + * Resumes displaying inApps notifications and shows pending inApp notifications if any. + * + * @returns {Promise} + */ + @Cordova() + resumeInAppNotifications(): Promise { + return; + } + /******************* * Session ******************/ @@ -676,6 +727,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { /**************************** * Notification Inbox methods ****************************/ + /** * Call this method to initialize the App Inbox */ @@ -785,293 +837,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } - /** - * Call this to SetUIEditor Connection - * - * @param enabled {boolean} - * @returns {Promise} - */ - @Cordova() - setUIEditorConnectionEnabled(enabled: boolean): Promise { - return; - } - - /** - * Call this to Register Boolean Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerBooleanVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register Double Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerDoubleVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register Integer Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerIntegerVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register String Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerStringVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register List of Boolean Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerListOfBooleanVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register List of Double Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerListOfDoubleVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register List of Integer Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerListOfIntegerVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register List of String Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerListOfStringVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register Map of Boolean Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerMapOfBooleanVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register Map of Double Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerMapOfDoubleVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register Map of Integer Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerMapOfIntegerVariable(varName: string): Promise { - return; - } - - /** - * Call this to Register Map of String Variable - * - * @param varName {string} - * @returns {Promise} - */ - @Cordova() - registerMapOfStringVariable(varName: string): Promise { - return; - } - - /** - * Call this to Get Boolean Variable - * - * @param varName {string} - * @param defaultValue {boolean} - * @returns {Promise} - */ - @Cordova() - getBooleanVariable(varName: string, defaultValue: boolean): Promise { - return; - } - - /** - * Call this to Get Double Variable - * - * @param varName {string} - * @param defaultValue {number} - * @returns {Promise} - */ - @Cordova() - getDoubleVariable(varName: string, defaultValue: number): Promise { - return; - } - - /** - * Call this to Get Integer Variable - * - * @param varName {string} - * @param defaultValue {number} - * @returns {Promise} - */ - @Cordova() - getIntegerVariable(varName: string, defaultValue: number): Promise { - return; - } - - /** - * Call this to Get String Variable - * - * @param varName {string} - * @param defaultValue {string} - * @returns {Promise} - */ - @Cordova() - getStringVariable(varName: string, defaultValue: string): Promise { - return; - } - - /** - * Call this to Get List of Boolean Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getListOfBooleanVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to Get List of Double Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getListOfDoubleVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to Get List of Integer Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getListOfIntegerVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to Get List of String Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getListOfStringVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to get Map of Boolean Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getMapOfBooleanVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to Get Map of Double Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getMapOfDoubleVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to Get Map of Integer Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getMapOfIntegerVariable(varName: string, defaultValue: any): Promise { - return; - } - - /** - * Call this to Get Map of String Variable - * - * @param varName {string} - * @param defaultValue {any} - * @returns {Promise} - */ - @Cordova() - getMapOfStringVariable(varName: string, defaultValue: any): Promise { - return; - } - /** * Call this to Get All Display Units * @@ -1208,7 +973,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { * @returns {Promise} */ @Cordova() - getString(): Promise { + getString(key: string): Promise { return; } @@ -1219,7 +984,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { * @returns {Promise} */ @Cordova() - getBoolean(): Promise { + getBoolean(key: string): Promise { return; } @@ -1230,7 +995,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { * @returns {Promise} */ @Cordova() - getLong(): Promise { + getLong(key: string): Promise { return; } @@ -1241,7 +1006,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin { * @returns {Promise} */ @Cordova() - getDouble(): Promise { + getDouble(key: string): Promise { return; }