From 21e3e37a0df0b099e857ff5eb0330a1ee5b6fe12 Mon Sep 17 00:00:00 2001 From: Anush-Shand <127097095+Anush-Shand@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:19:19 +0530 Subject: [PATCH] feat(clevertap): support clevertap-cordova 3.3.0 (#4883) * 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 --------- 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> Co-authored-by: Piyush Kukadiya Co-authored-by: piyush-kukadiya <61137760+piyush-kukadiya@users.noreply.github.com> Co-authored-by: AishwaryaNanna <97506871+AishwaryaNanna@users.noreply.github.com> --- .../plugins/clevertap/index.ts | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) diff --git a/src/@awesome-cordova-plugins/plugins/clevertap/index.ts b/src/@awesome-cordova-plugins/plugins/clevertap/index.ts index 76a005c201..e1d97899dc 100644 --- a/src/@awesome-cordova-plugins/plugins/clevertap/index.ts +++ b/src/@awesome-cordova-plugins/plugins/clevertap/index.ts @@ -662,6 +662,17 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } + /** + * Deletes all types of files which are preloaded for SDK features like custom in-app templates, app functions and variables etc. + * + * @param expiredOnly {boolean} - to clear only assets which will not be needed further for inapps + * @returns {Promise} + */ + @Cordova() + clearFileResources(expiredOnly: boolean): Promise { + return; + } + /** * Fetches In Apps from server. * @@ -1132,6 +1143,16 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } + /** + * Create File Variable + * @returns {Promise} + * @param {string} variable The String specifying the name of file varible to be created. + */ + @Cordova() + defineFileVariable(variable: string): Promise { + return; + } + /** * Get a variable or a group for the specified name. * @param {string} name - name. @@ -1170,6 +1191,177 @@ export class CleverTap extends AwesomeCordovaNativePlugin { return; } + + /** + * Called when the value of the file variable is downloaded and ready + * @param {name} string the name of the variable + * @returns {Promise} + */ + @Cordova() + onFileValueChanged(name: string): Promise { + return; + } + + /** + * Adds a callback to be invoked when variables are initialised with server values. Will be called only once on app start, or when added if server values are already received + * @returns {Promise} + */ + @Cordova() + onOneTimeVariablesChanged(): Promise { + return; + } + + /** + * Adds a callback to be invoked when no files need to be downloaded or all downloads have been completed. It is called each time new values are fetched and downloads are completed. + * @returns {Promise} + */ + @Cordova() + onVariablesChangedAndNoDownloadsPending(): Promise { + return; + } + + /** + * Adds a callback to be invoked only once for when new values are fetched and downloaded + * @returns {Promise} + */ + @Cordova() + onceVariablesChangedAndNoDownloadsPending(): Promise { + return; + } + + + /**************************** + * Custom Templates methods + ****************************/ + + /** + * + * Uploads Custom in-app templates and app functions to the server. Requires Development/Debug build/configuration. + * @returns {Promise} + */ + @Cordova() + syncCustomTemplates(): Promise { + return; + } + + /** + * Uploads Custom in-app templates and app functions to the server. + * @param {boolean} isProduction Provide `true` if templates must be sync in Productuon build/configuration. + * @returns {Promise} + * + * + * Note: This is NO-OP in Android + */ + @Cordova() + syncCustomTemplatesInProd(isProduction: boolean): Promise { + return; + } + + /** + * Notify the SDK that an active custom template is dismissed. The active custom template is considered to be + * visible to the user until this method is called. Since the SDK can show only one InApp message at a time, all + * other messages will be queued until the current one is dismissed. + * @param {string} templateName The name of the active template + * @returns {Promise} + */ + @Cordova() + customTemplateSetDismissed(templateName: string): Promise { + return; + } + + + /** + * Notify the SDK that an active custom template is presented to the user. + * @param {string} templateName The name of the active template + * @returns {Promise} + */ + @Cordova() + customTemplateSetPresented(templateName: string): Promise { + return; + } + + /** + * Trigger a custom template action argument by name. + * + * @param {string} templateName The name of an active template for which the action is defined + * @param {string} argName The action argument na + * @returns {Promise} + */ + @Cordova() + customTemplateRunAction(templateName: string, argName: string): Promise { + return; + } + + /** + * Retrieve a string argument by name. + * + * @param {string} templateName The name of an active template for which the argument is defined + * @param {string} argName The action argument name + * @returns {Promise} + */ + @Cordova() + customTemplateGetStringArg(templateName: string, argName: string): Promise { + return; + } + + /** + * Retrieve a number argument by name. + * + * @param {string} templateName The name of an active template for which the argument is defined + * @param {string} argName The action argument name + * @returns {Promise} + */ + @Cordova() + customTemplateGetNumberArg(templateName: string, argName: string): Promise { + return; + } + + /** + * Retrieve a boolean argument by name. + * + * @param {string} templateName The name of an active template for which the argument is defined + * @param {string} argName The action argument name + * @returns {Promise} + */ + @Cordova() + customTemplateGetBooleanArg(templateName: string, argName: string): Promise { + return; + } + + /** + * Retrieve a file argument by name. + * + * @param {string} templateName The name of an active template for which the argument is defined + * @param {string} argName The action argument name + * @returns {Promise} + */ + @Cordova() + customTemplateGetFileArg(templateName: string, argName: string): Promise { + return; + } + + /** + * Retrieve an object argument by name. + * + * @param {string} templateName The name of an active template for which the argument is defined + * @param {string} argName The action argument name + * @returns {Promise} + */ + @Cordova() + customTemplateGetObjectArg(templateName: string, argName: string): Promise { + return; + } + + /** + * Get a string representation of an active's template context with information about all arguments. + * @param {string} templateName The name of an active template + * @returns {Promise} + */ + @Cordova() + customTemplateContextToString(templateName: string): Promise { + return; + } + /**************************** * Android 13 Push Primer ****************************/