Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clevertap-cordova

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clevertap-cordova - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

.idea/inspectionProfiles/Project_Default.xml

28

CHANGELOG.md
Change Log
==========
Version 3.3.0 *(December 3, 2024)*
-------------------------------------------
#### New Features
**Android Specific**
* Supports [CleverTap Android SDK v7.0.3](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-703-november-29-2024).
* Removes character limit of maximum 3 lines from AppInbox messages
* Adds support for `AndroidX Media3` in lieu of the [deprecation](https://developer.android.com/media/media3/exoplayer/migration-guide) of `ExoPlayer`. While Clevertap continues to support `ExoPlayer`, migration is recommended. For migration refer [here](docs/Integrate-Android.md#migrating-from-exoplayer-to-androidx-media3-optional).
**iOS specific**
* Supports [CleverTap iOS SDK v7.0.3](https://github.com/CleverTap/clevertap-ios-sdk/blob/master/CHANGELOG.md#version-703-november-29-2024).
**Common for both Android and iOS**
* Adds support for triggering InApps based on user attribute changes.
* Adds support for File Type Variables in Remote Config. Please refer to the [Remote Config Variables](docs/Variables.md) doc to read more on how to integrate this in your app.
* Adds support for Custom Code Templates. Please refer to the [CustomCodeTemplates](docs/CustomCodeTemplates.md) doc to read more on how to integrate this in your app.
* Changes campaign triggering evaluation of event names, event properties, and profile properties to ignore letter case and whitespace.
* Adds support for previewing in-apps created through the new dashboard advanced builder.
* Adds support for custom handshake domain configuration.
#### Bug Fixes
**Android Specific**
* Fixes an ANR caused by extremely old InApp campaigns.
* Fixes an issue where incorrect callbacks were sent for InApps when the phone was rotated.
* Fixes an issue where an InApp was displayed even after all the campaigns were stopped.
* Fixes an issue where the InApp image was not shown when the phone was rotated to landscape.
* Fixes an issue where certain URLs loaded incorrectly in custom HTML InApp templates.
Version 3.2.0 *(August 12, 2024)*

@@ -5,0 +33,0 @@ -------------------------------------------

12

docs/Integrate-Android.md

@@ -67,4 +67,14 @@ # 👩‍💻 Android Integration

// SUB-PROJECT DEPENDENCIES END
```
```
### Migrating from `Exoplayer` to `AndroidX Media3` (Optional)
Clevertap ReactNative SDK supports `AndroidX Media3` from `v3.0.0+` to replace the deprecated `ExoPlayer` libraries. For migration change the following dependencies.
| Old Dependency | New Dependency |
|-----------------------:|:--------------------|
| `com.google.android.exoplayer:exoplayer:2.19.1` | `androidx.media3:media3-exoplayer:1.1.1` |
| `com.google.android.exoplayer:exoplayer-hls:2.19.1` | `androidx.media3:media3-exoplayer-hls:1.1.1` |
| `com.google.android.exoplayer:exoplayer-ui:2.19.1` | `androidx.media3:media3-ui:1.1.1` |
+ **Support AndroidX**

@@ -71,0 +81,0 @@

@@ -30,2 +30,10 @@ # Overview

# Define File Variables
CleverTap Cordova SDK supports file types for variables from version `3.3.0`. Supported file types include but are not limited to images (jpg, jpeg, png, gif), text files, and PDFs.
```javascript
this.clevertap.defineFileVariable("fileVariable");
```
# Setup Callbacks

@@ -35,2 +43,13 @@

- Status of fetch variables request
- `onVariablesChanged`
- `onValueChanged`
From version `3.3.0` onwards, the following callbacks are also supported:
- `onOneTimeVariablesChanged`
- `onVariablesChangedAndNoDownloadsPending`
- `onceVariablesChangedAndNoDownloadsPending`
- `onFileValueChanged`
## Status of Variables Fetch Request

@@ -57,5 +76,37 @@

```javascript
this.clevertap.onValueChanged(key,val => log("Changed value is "+JSON.stringify(val)));
this.clevertap.onValueChanged(key,val => log("Changed value is "+JSON.stringify(val)));
```
## `onOneTimeVariablesChanged`
This callback is invoked once when variables are initialized with a value or changed with a new server value. Callback is triggered only once on app start, or when added if server values are already received
```javascript
this.clevertap.onOneTimeVariablesChanged(val => log("onOneTimeVariablesChanged value is ", + JSON.stringify(val)));
```
## `onVariablesChangedAndNoDownloadsPending`
This callback is invoked when variable values are changed and the files associated with it are downloaded and ready to be used. Callback is triggered each time new values are fetched and downloaded.
```javascript
this.clevertap.onVariablesChangedAndNoDownloadsPending(val => log("onVariablesChangedAndNoDownloadsPending value is ", + JSON.stringify(val)));
```
## `onceVariablesChangedAndNoDownloadsPending`
This callback is invoked only once when variable values are changed and the files associated with it are downloaded and ready to be used. Callback is triggered only once for when new values are fetched and downloaded
```javascript
this.clevertap.onceVariablesChangedAndNoDownloadsPending(val => log("onceVariablesChangedAndNoDownloadsPending value is ", + JSON.stringify(val)));
```
## `onFileValueChanged`
This callback is registered per file variable. It is called when the file associated with the file variable is downloaded and ready to be used.
```javascript
this.clevertap.onFileValueChanged(key,val => log("Changed value of file is "+JSON.stringify(val)));
```
# Sync Defined Variables

@@ -62,0 +113,0 @@

2

package.json
{
"name": "clevertap-cordova",
"version": "3.2.0",
"version": "3.3.0",
"description": "CleverTap Plugin for Cordova/PhoneGap",

@@ -5,0 +5,0 @@ "cordova": {

@@ -22,4 +22,4 @@ <p align="center">

- [CleverTap Android SDK version 6.2.1](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev6.2.1)
- [CleverTap iOS SDK version 6.2.1](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/6.2.1)
- [CleverTap Android SDK version 7.0.3](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev7.0.3)
- [CleverTap iOS SDK version 7.0.3](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/7.0.3)

@@ -26,0 +26,0 @@ ## 🚀 Installation and Quick Start

@@ -1,2 +0,2 @@

// Copyright (C) 2015 CleverTap
// Copyright (C) 2015 CleverTap
//

@@ -647,2 +647,10 @@ // This code is provided under a commercial License.

/**
Create file variable.
@param {string} fileVariable The name specifying the file variable to be created.
*/
CleverTap.prototype.defineFileVariable = function (variable) {
cordova.exec(null, null, "CleverTapPlugin", "defineFileVariable", [variable]);
}
/**
Get a variable or a group for the specified name.

@@ -671,2 +679,10 @@ @param {string} name - name.

/**
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
@param {function} handler The callback to add
*/
CleverTap.prototype.onOneTimeVariablesChanged = function (handler) {
cordova.exec(handler, null, "CleverTapPlugin", "onOneTimeVariablesChanged", []);
}
/**
Called when the value of the variable changes.

@@ -680,2 +696,29 @@ @param {name} string the name of the variable

/**
Adds a callback to be invoked when the value of the file variable is downloaded and ready. This is only available for File variables.
@param {name} string the name of the file variable
@param {function} handler The callback to add
*/
CleverTap.prototype.onFileValueChanged = function (name, handler) {
cordova.exec(handler, null, "CleverTapPlugin", "onFileValueChanged", [name]);
}
/**
*
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.
@param {function} handler The callback to add
*/
CleverTap.prototype.onVariablesChangedAndNoDownloadsPending = function (handler) {
cordova.exec(handler, null, "CleverTapPlugin", "onVariablesChangedAndNoDownloadsPending", []);
}
/**
Adds a callback to be invoked only once for when new values are fetched and downloaded
@param {function} handler The callback to add
*/
CleverTap.prototype.onceVariablesChangedAndNoDownloadsPending = function (handler) {
cordova.exec(handler, null, "CleverTapPlugin", "onceVariablesChangedAndNoDownloadsPending", []);
}
/****************************

@@ -712,2 +755,184 @@ * Android 13 Push Primer

/**
Deletes all types of files which are preloaded for SDK features like custom in-app templates, app functions and variables etc.
@param {expiredOnly} to clear only assets which will not be needed further for inapps
*/
CleverTap.prototype.clearFileResources = function (expiredOnly) {
cordova.exec(null, null, "CleverTapPlugin", "clearFileResources", [expiredOnly]);
}
/**
* Uploads Custom in-app templates and app functions to the server.
* Requires Development/Debug build/configuration.
*/
CleverTap.prototype.syncCustomTemplates = function () {
cordova.exec(null, null, "CleverTapPlugin", "syncCustomTemplates", []);
}
/**
* 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.
*/
CleverTap.prototype.syncCustomTemplatesInProd = function(isProduction){
cordova.exec(null, null, "CleverTapPlugin", "syncCustomTemplatesInProd", [isProduction]);
}
/**
* 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
*/
CleverTap.prototype.customTemplateSetDismissed = function(templateName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateSetDismissed",
[templateName]
);
});
}
/**
* Notify the SDK that an active custom template is presented to the user.
* @param {string} templateName The name of the active template
*/
CleverTap.prototype.customTemplateSetPresented = function(templateName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateSetPresented",
[templateName]
);
});
}
/**
* 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
*/
CleverTap.prototype.customTemplateRunAction = function(templateName,argName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateRunAction",
[templateName,argName]
);
});
}
/**
* 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
*/
CleverTap.prototype.customTemplateGetStringArg = function(templateName,argName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateGetStringArg",
[templateName,argName]
);
});
}
/**
* 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
*/
CleverTap.prototype.customTemplateGetNumberArg = function(templateName,argName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateGetNumberArg",
[templateName,argName]
);
});
}
/**
* 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
*/
CleverTap.prototype.customTemplateGetBooleanArg = function(templateName,argName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateGetBooleanArg",
[templateName,argName]
);
});
}
/**
* 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
*/
CleverTap.prototype.customTemplateGetFileArg = function(templateName,argName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateGetFileArg",
[templateName,argName]
);
});
}
/**
* 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
*/
CleverTap.prototype.customTemplateGetObjectArg = function(templateName,argName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateGetObjectArg",
[templateName,argName]
);
});
}
/**
* Get a string representation of an active's template context with information about all arguments.
* @param {string} templateName The name of an active template
*/
CleverTap.prototype.customTemplateContextToString = function(templateName){
return new Promise((resolve, reject) => {
cordova.exec(
resolve,
reject,
"CleverTapPlugin",
"customTemplateContextToString",
[templateName]
);
});
}
/**
Fetches In Apps from server.

@@ -714,0 +939,0 @@ @param {successCallback} Callback to be invoked when fetching is done.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc