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

clevertap-cordova

Package Overview
Dependencies
Maintainers
4
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.3.2 to 2.3.3

.codebeatignore

5

CHANGELOG.md
Change Log
==========
Version 2.3.3 *(24 February, 2021)*
-------------------------------------------
* Added Push Notification with Custom Extras callback support in the killed state
* Update for CleverTap iOS SDK v3.9.2
Version 2.3.2 *(07 January, 2021)*

@@ -5,0 +10,0 @@ -------------------------------------------

2

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

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

<p align="center">
<img src="https://github.com/CleverTap/clevertap-cordova/blob/SDK-366-ios-as-podspec/images/clevertap-logo.png" width="300"/>
<img src="images/clevertap-logo.png" width="300"/>
</p>

@@ -16,3 +16,3 @@

For more information check out our [website](https://clevertap.com/ "CleverTap") and [documentation](https://developer.clevertap.com/docs/ "CleverTap Technical Documentation").
For more information check out our [website](https://clevertap.com/ "CleverTap") and [documentation](https://developer.clevertap.com/docs/ "CleverTap Technical Documentation").

@@ -23,7 +23,5 @@ To get started, sign up [here](https://clevertap.com/live-product-demo/).

Tested on Cordova 10.0.0
- [CleverTap Android SDK version 4.0.2](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/core-v4.0.2)
- [CleverTap iOS SDK version 3.9.2](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/3.9.2)
- [CleverTap Android SDK version 4.0.0](https://github.com/CleverTap/clevertap-android-sdk/releases/tag/core-v4.0.0)
- [CleverTap iOS SDK version 3.9.1](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/3.9.1)
## 🚀 Install

@@ -61,9 +59,9 @@

##### For Ionic3
##### For Ionic 5
```sh
npm install @ionic-native/clevertap --save
```
- [See the included Ionic3 Example project for usage](https://github.com/CleverTap/clevertap-cordova/blob/master/Ionic3Example/src/app/app.component.ts).
- [See the included Ionic 5 Example project for usage](/Samples/IonicCordova/IonicCordovaAngularProject/src/app/app.component.ts).
- Be sure to [add CleverTap as a provider in your app module](https://github.com/CleverTap/clevertap-cordova/blob/master/Ionic3Example/src/app/app.module.ts).
- Be sure to [add CleverTap as a provider in your app module](/Samples/IonicCordova/IonicCordovaAngularProject/src/app/app.module.ts).
```javascript

@@ -87,32 +85,2 @@ constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, clevertap: CleverTap) {

##### Using PhoneGap Build
**Starting with v2.0.0, the plugin drops official support for PhoneGap Build.**
This is because PhoneGap Build does not support install hooks and a hook is required to configure FCM.
It might be possible by forking this plugin and replacing the placeholder google-services.json in src/android with yours, and then hard coding your google app id and api key in plugin.xml, but you're on your own there.
When using the plugin with PhoneGap Build:
Add the following to your `www/config.xml` file:
```xml
<preference name="android-build-tool" value="gradle" />
<gap:plugin name="clevertap-cordova" source="npm">
<param name="CLEVERTAP_ACCOUNT_ID" value="YOUR CLEVERTAP ACCOUNT ID" />
<param name="CLEVERTAP_TOKEN" value="YOUR CLEVERTAP ACCOUNT TOKEN" />
<param name="GCM_PROJECT_NUMBER" value="YOUR GCM PROJECT NUMBER" /> // for v1.2.5 and lower of the plugin
</gap:plugin>
```
*For PhoneGap Build Android projects*: **Extremely Important**: add `CleverTap.notifyDeviceReady();` to your onDeviceReady callback in `www/js/index.js`:
```javascript
onDeviceReady: function() {
app.receivedEvent('deviceready');
CleverTap.notifyDeviceReady();
...
},
```
#### Android

@@ -311,4 +279,4 @@

- [See the included Example Cordova project for usage](https://github.com/CleverTap/clevertap-cordova/blob/master/ExampleProject/www/js/index.js).
- [See the included Example Cordova project for usage](/Samples/Cordova/ExampleProject/www/js/index.js).
- [See the included Ionic3 Example project for usage](https://github.com/CleverTap/clevertap-cordova/blob/master/Ionic3Example/src/app/app.component.ts).
- [See the included Ionic Example project for usage](/Samples/IonicCordova/IonicCordovaAngularProject/src/app/app.component.ts).

@@ -135,15 +135,3 @@ // Copyright (C) 2015 CleverTap

CleverTap.prototype.recordEventWithNameAndProps = function (eventName, eventProps) {
//automatic conversion of date object in suitable CleverTap format
/*-------------- * -----------------
| input => output |
* --------------------------------- *
| new Date() => $D_epoch |
---------------- * ----------------- */
for (let [key, value] of Object.entries(eventProps)) {
if (Object.prototype.toString.call(value) === '[object Date]') {
eventProps[key] = "$D_" + Math.floor(value.getTime()/1000);
}
}
convertDateToEpochInProperties(eventProps)
cordova.exec(null, null, "CleverTapPlugin", "recordEventWithNameAndProps", [eventName, eventProps]);

@@ -156,2 +144,7 @@ }

CleverTap.prototype.recordChargedEventWithDetailsAndItems = function (details, items) {
convertDateToEpochInProperties(details)
// iterate over the array & convert the date items to CleverTap's server supported $D String
for (var i = 0; i < items.length; i++) {
convertDateToEpochInProperties(items[i])
}
cordova.exec(null, null, "CleverTapPlugin", "recordChargedEventWithDetailsAndItems", [details, items]);

@@ -262,2 +255,3 @@ }

CleverTap.prototype.onUserLogin = function (profile) {
convertDateToEpochInProperties(profile)
cordova.exec(null, null, "CleverTapPlugin", "onUserLogin", [profile]);

@@ -269,2 +263,3 @@ }

CleverTap.prototype.profileSet = function (profile) {
convertDateToEpochInProperties(profile)
cordova.exec(null, null, "CleverTapPlugin", "profileSet", [profile]);

@@ -640,2 +635,17 @@ }

function convertDateToEpochInProperties(items){
//Conversion of date object in suitable CleverTap format
/*-------------- * -----------------
| input => output |
* --------------------------------- *
| new Date() => $D_epoch |
---------------- * ----------------- */
for (let [key, value] of Object.entries(items)) {
if (Object.prototype.toString.call(value) === '[object Date]') {
items[key] = "$D_" + Math.floor(value.getTime()/1000);
}
}
}
module.exports = new CleverTap();

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