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

clevertap-cordova

Package Overview
Dependencies
Maintainers
9
Versions
69
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 2.6.2 to 2.7.0

docs/pushprimer.md

63

CHANGELOG.md
Change Log
==========
Version 2.7.0 *(August 2, 2023)*
-------------------------------------------
#### New Features
**Android specific**
* Supports [CleverTap Android SDK v5.1.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev5.1.0_ptv1.1.0).
* Supports [cordova android 12.0.0](https://cordova.apache.org/announcements/2023/05/22/cordova-android-12.0.0.html)
* `deleteInboxMessagesForIds(messageIDs)` is now supported in Android as well.
* New callback `onCleverTapInAppNotificationShow(JSONObject)`
* **Behavioral change of `onCleverTapInboxItemClick`**:
- Previously, the callback was raised when the App Inbox Item is clicked.
- Now, it is also raised when the App Inbox button and Item is clicked.
**iOS specific**
* Supports [CleverTap iOS SDK v5.1.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.1.2).
* Supports [cordova ios 7.0.0](https://cordova.apache.org/announcements/2023/07/10/cordova-ios-7.0.0.html)
**Common for both android and iOS**
* Adds below new public APIs for supporting [Android 13 notification runtime permission](https://developer.android.com/develop/ui/views/notifications/notification-permission)
* `isPushPermissionGranted(successCallback)` [Usage can be found here](docs/pushprimer.md#get-the-push-notification-permission-status)
* `promptPushPrimer(JSONObject)` [Usage can be found here](docs/pushprimer.md#push-primer-using-half-interstitial-local-in-app)
* `promptForPushPermission(boolean)` [Usage can be found here](docs/pushprimer.md#prompt-the-notification-permission-dialog-without-push-primer)
* New callback `onCleverTapPushPermissionResponseReceived` available which returns after user Allows/Denies notification permission [Usage can be found here](docs/pushprimer.md#available-callbacks-for-push-primer)
* Adds support for Remote Config Variables. Please refer to the [Variables.md](docs/Variables.md) file to
read more on how to integrate this to your app.
* Adds new API, `markReadInboxMessagesForIds(messageIDs)` to mark read an array of
Inbox Messages.
* Adds new API, `dismissInbox()` to dismiss the App Inbox.
#### API Changes
* **Deprecated:** The following methods and callbacks related to Product Config and Feature Flags have
been marked as deprecated in this release, instead use new remote config variables feature. These
methods and callbacks will be removed in the future versions with prior notice.
* Product config
- `setDefaultsMap()`
- `fetch()`
- `fetchWithMinimumFetchIntervalInSeconds()`
- `activate()`
- `fetchAndActivate()`
- `setMinimumFetchIntervalInSeconds()`
- `getLastFetchTimeStampInMillis()`
- `getString()`
- `getBoolean()`
- `getLong()`
- `getDouble()`
- `reset()`
- callback `onCleverTapProductConfigDidInitialize`
- callback `onCleverTapProductConfigDidFetch`
- callback `onCleverTapProductConfigDidActivate`
* Feature flags
- `getFeatureFlag()`
- callback `onCleverTapFeatureFlagsDidUpdate`
#### Breaking API Changes
* **Return value change of `onCleverTapInboxItemClick` callback in android and `messageDidSelect` callback in iOS**: callback returns `JSONObject` with below entries
- `data` corresponds to the payload of clicked inbox item
- The `contentPageIndex` corresponds to the page index of the content, which ranges from 0 to the total number of pages for carousel templates. For non-carousel templates, the value is always 0, as they only have one page of content.
- The `buttonIndex` represents the index of the App Inbox button clicked (0, 1, or 2). A value of -1 indicates the App Inbox item is clicked.
Version 2.6.2 *(April 18, 2023)*

@@ -4,0 +67,0 @@ -------------------------------------------

26

docs/Usage.md

@@ -25,2 +25,4 @@

```javascript
document.addEventListener('onCleverTapPushPermissionResponse', this.onCleverTapPushPermissionResponse,false);
document.addEventListener('onCleverTapInAppNotificationShow', this.onCleverTapInAppNotificationShow,false);// Only for Android, NO-OP for iOS
document.addEventListener('deviceready', this.onDeviceReady, false);

@@ -44,3 +46,13 @@ document.addEventListener('onCleverTapProfileSync', this.onCleverTapProfileSync, false); // optional: to be notified of CleverTap user profile synchronization updates

// Push Permission
onCleverTapPushPermissionResponse: function(e) {
console.log(e.accepted)
},
// on inapp displayed, Only for Android, NO-OP for iOS
onCleverTapInAppNotificationShow: function(e) {
log("onCleverTapInAppNotificationShow")
log(e.customExtras)
},
// deep link handling

@@ -242,3 +254,3 @@ onDeepLink: function(e) {

#### Delete bulk messages with Ids - Only for iOS, NO-OP for Android.
#### Delete bulk messages with Ids - Only for iOS, NO-OP for Android [*v2.7.0* onwards Android adds support for this method].

@@ -255,2 +267,14 @@ ```javascript

#### Mark bulk Inbox messages with Ids as Read
```javascript
this.clevertap.markReadInboxMessagesForIds(['message_ID_1234','message_ID_xyz']);
```
#### Dismiss the App Inbox
```javascript
this.clevertap.dismissInbox();
```
#### pushInbox Notification Viewed Event For Id

@@ -257,0 +281,0 @@

11

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

@@ -23,4 +23,4 @@ "cordova": {

"engines": {
"cordovaDependencies": {
"2.3.2": {
"cordovaDependencies": {
"2.3.2": {
"cordova-ios": ">=4.3.0",

@@ -34,2 +34,7 @@ "cordova-android": ">6.3.0",

"cordova": ">=11.0.0"
},
"2.7.0": {
"cordova-ios": ">=4.3.0",
"cordova-android": ">=12.0.0",
"cordova": ">=12.0.0"
}

@@ -36,0 +41,0 @@ }

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

- [CleverTap Android SDK version 4.6.6](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev4.6.6)
- [CleverTap iOS SDK version 4.2.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/4.2.2)
- [CleverTap Android SDK version 5.1.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/corev5.1.0_ptv1.1.0)
- [CleverTap iOS SDK version 5.1.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.1.2)

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

@@ -9,2 +9,5 @@ // Copyright (C) 2015 CleverTap

var CleverTap = function () {
const libName = 'Cordova';
const libVersion = 20603;
cordova.exec(null, null, "CleverTapPlugin", "setLibrary", [libName, libVersion]);
}

@@ -461,2 +464,10 @@

CleverTap.prototype.markReadInboxMessagesForIds = function (messageIds) {
cordova.exec(null, null, "CleverTapPlugin", "markReadInboxMessagesForIds", [messageIds]);
}
CleverTap.prototype.dismissInbox= function () {
cordova.exec(null, null, "CleverTapPlugin", "dismissInbox", []);
}
CleverTap.prototype.pushInboxNotificationViewedEventForId = function (messageId) {

@@ -517,2 +528,5 @@ cordova.exec(null, null, "CleverTapPlugin", "pushInboxNotificationViewedEventForId", [messageId]);

****************************/
/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.getFeatureFlag = function(name,defaultValue,successCallback){

@@ -525,2 +539,5 @@ cordova.exec(successCallback, null, "CleverTapPlugin", "getFeatureFlag", [name,defaultValue]);

****************************/
/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.setDefaultsMap = function(jsonMap){

@@ -530,2 +547,5 @@ cordova.exec(null, null, "CleverTapPlugin", "setDefaultsMap", [jsonMap]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.fetch = function(){

@@ -535,2 +555,5 @@ cordova.exec(null, null, "CleverTapPlugin", "fetch", []);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.fetchWithMinimumFetchIntervalInSeconds = function(interval){

@@ -540,2 +563,5 @@ cordova.exec(null, null, "CleverTapPlugin", "fetchWithMinimumFetchIntervalInSeconds", [interval]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.activate = function(){

@@ -545,2 +571,5 @@ cordova.exec(null, null, "CleverTapPlugin", "activate", []);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.fetchAndActivate = function(){

@@ -550,2 +579,5 @@ cordova.exec(null, null, "CleverTapPlugin", "fetchAndActivate", []);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.setMinimumFetchIntervalInSeconds = function(interval){

@@ -555,2 +587,5 @@ cordova.exec(null, null, "CleverTapPlugin", "setMinimumFetchIntervalInSeconds", [interval]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.getLastFetchTimeStampInMillis = function(successCallback){

@@ -560,2 +595,5 @@ cordova.exec(successCallback, null, "CleverTapPlugin", "getLastFetchTimeStampInMillis", []);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.getString = function(key,successCallback){

@@ -565,2 +603,5 @@ cordova.exec(successCallback, null, "CleverTapPlugin", "getString", [key]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.getBoolean = function(key,successCallback){

@@ -570,2 +611,5 @@ cordova.exec(successCallback, null, "CleverTapPlugin", "getBoolean", [key]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.getLong = function(key,successCallback){

@@ -575,2 +619,5 @@ cordova.exec(successCallback, null, "CleverTapPlugin", "getLong", [key]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.getDouble = function(key,successCallback){

@@ -580,2 +627,5 @@ cordova.exec(successCallback, null, "CleverTapPlugin", "getDouble", [key]);

/**
* @deprecated - Since version 2.7.0 and will be removed in the future versions of this SDK.
*/
CleverTap.prototype.reset = function(){

@@ -585,2 +635,85 @@ cordova.exec(null, null, "CleverTapPlugin", "reset", []);

/****************************
* Product Experiences methods
****************************/
/**
Uploads variables to the server. Requires Development/Debug build/configuration.
*/
CleverTap.prototype.syncVariables = function(){
cordova.exec(null, null, "CleverTapPlugin", "syncVariables", []);
}
/**
Uploads variables to the server.
@param {boolean} isProduction Provide `true` if variables must be sync in Productuon build/configuration.
*/
CleverTap.prototype.syncVariablesinProd = function(isProduction){
cordova.exec(null, null, "CleverTapPlugin", "syncVariablesinProd", [isProduction]);
}
/**
Forces variables to update from the server.
*/
CleverTap.prototype.fetchVariables = function(successCallback){
cordova.exec(successCallback, null, "CleverTapPlugin", "fetchVariables", []);
}
/**
Create variables.
@param {object} variables The JSON Object specifying the varibles to be created.
*/
CleverTap.prototype.defineVariables = function (variables) {
cordova.exec(null, null, "CleverTapPlugin", "defineVariables", [variables]);
}
/**
Get a variable or a group for the specified name.
@param {string} name - name.
*/
CleverTap.prototype.getVariable = function (name, successCallback) {
cordova.exec(successCallback, null, "CleverTapPlugin", "getVariable", [name]);
}
/**
Get all variables via a JSON object.
*/
CleverTap.prototype.getVariables = function (successCallback) {
cordova.exec(successCallback, null, "CleverTapPlugin", "getVariables", []);
}
/**
Adds a callback to be invoked when variables are initialised with server values. Will be called each time new values are fetched.
@param {function} handler The callback to add
*/
CleverTap.prototype.onVariablesChanged = function (handler) {
cordova.exec(handler, null, "CleverTapPlugin", "onVariablesChanged", []);
}
/**
Called when the value of the variable changes.
@param {name} string the name of the variable
@param {function} handler The callback to add
*/
CleverTap.prototype.onValueChanged = function (name, handler) {
cordova.exec(handler, null, "CleverTapPlugin", "onValueChanged", [name]);
}
/****************************
* Android 13 Push Primer
****************************/
CleverTap.prototype.promptPushPrimer = function(localInAppObject){
cordova.exec(null, null, "CleverTapPlugin", "promptPushPrimer", [localInAppObject]);
}
CleverTap.prototype.promptForPushPermission = function(showFallbackSettings){
cordova.exec(null, null, "CleverTapPlugin", "promptForPushPermission", [showFallbackSettings]);
}
CleverTap.prototype.isPushPermissionGranted = function(successCallback){
cordova.exec(successCallback, null, "CleverTapPlugin", "isPushPermissionGranted", []);
}
function convertDateToEpochInProperties(items){

@@ -587,0 +720,0 @@ //Conversion of date object in suitable CleverTap format

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