CleverTap
Cordova Plugin that wraps CleverTap SDK for Android and iOS
Repo: https://github.com/CleverTap/clevertap-cordova
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add clevertap-cordova $ npm install --save @ionic-native/clevertap@4 - Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { CleverTap } from '@ionic-native/clevertap';
constructor(private clevertap: CleverTap) { }
Instance Members
notifyDeviceReady()
notify device ready NOTE: in iOS use to be notified of launch Push Notification or Deep Link in Android use only in android phonegap build projects
Returns: Promise<any>
enablePersonalization()
Personalization ****** Personalization Enables the Personalization API
Returns: Promise<any>
setOptOut(optOut)
Enables tracking opt out for the currently active user.
| Param | Type | Details |
|---|---|---|
| optOut |
boolean
|
Returns: Promise<any>
enableDeviceNetworkInfoReporting(enable)
Enables the reporting of device network related information, including IP address. This reporting is disabled by default.
| Param | Type | Details |
|---|---|---|
| enable |
boolean
|
Returns: Promise<any>
registerPush()
Push ****** Registers for push notifications
Returns: Promise<any>
setPushToken(token)
Sets the device’s push token
| Param | Type | Details |
|---|---|---|
| token |
string
|
Returns: Promise<any>
createNotificationChannel(channelID, channelName, channelDescription, importance, showBadge)
Create Notification Channel for Android O+
| Param | Type | Details |
|---|---|---|
| channelID |
string
|
|
| channelName |
string
|
|
| channelDescription |
string
|
|
| importance |
number
|
|
| showBadge |
boolean
|
Returns: Promise<any>
createNotificationChannelWithSound(channelID, channelName, channelDescription, importance, showBadge, sound)
Create Notification Channel for Android O+
| Param | Type | Details |
|---|---|---|
| channelID |
string
|
|
| channelName |
string
|
|
| channelDescription |
string
|
|
| importance |
number
|
|
| showBadge |
boolean
|
|
| sound |
string
|
Returns: Promise<any>
createNotificationChannelWithGroupId(channelID, channelName, channelDescription, importance, groupId, showBadge, sound)
Create Notification Channel with Group ID for Android O+
| Param | Type | Details |
|---|---|---|
| channelID |
string
|
|
| channelName |
string
|
|
| channelDescription |
string
|
|
| importance |
number
|
|
| groupId |
string
|
|
| showBadge |
boolean
|
|
| sound |
string
|
Returns: Promise<any>
createNotificationChannelWithGroupIdAndSound(channelID, channelName, channelDescription, importance, groupId, showBadge)
Create Notification Channel with Group ID for Android O+
| Param | Type | Details |
|---|---|---|
| channelID |
string
|
|
| channelName |
string
|
|
| channelDescription |
string
|
|
| importance |
number
|
|
| groupId |
string
|
|
| showBadge |
boolean
|
Returns: Promise<any>
createNotificationChannelGroup(groupID, groupName)
Create Notification Channel Group for Android O+
| Param | Type | Details |
|---|---|---|
| groupID |
string
|
|
| groupName |
string
|
Returns: Promise<any>
deleteNotificationChannel(channelID)
Delete Notification Channel for Android O+
| Param | Type | Details |
|---|---|---|
| channelID |
string
|
Returns: Promise<any>
deleteNotificationChannelGroup(groupID)
Delete Notification Group for Android O+
| Param | Type | Details |
|---|---|---|
| groupID |
string
|
Returns: Promise<any>
recordScreenView(screenName)
Events ****** Record Screen View
| Param | Type | Details |
|---|---|---|
| screenName |
string
|
Returns: Promise<any>
recordEventWithName(eventName)
Record Event with Name
| Param | Type | Details |
|---|---|---|
| eventName |
string
|
Returns: Promise<any>
recordEventWithNameAndProps(eventName, eventProps)
Record Event with Name and Event properties
| Param | Type | Details |
|---|---|---|
| eventName |
string
|
|
| eventProps |
any
|
Returns: Promise<any>
recordChargedEventWithDetailsAndItems(details, items)
Record Charged Event with Details and Items
| Param | Type | Details |
|---|---|---|
| details |
any
|
object with transaction details |
| items |
any
|
array of items purchased |
Returns: Promise<any>
eventGetFirstTime(eventName)
Get Event First Time
| Param | Type | Details |
|---|---|---|
| eventName |
string
|
callback returns epoch seconds or -1 |
Returns: Promise<any>
eventGetLastTime(eventName)
Get Event Last Time
| Param | Type | Details |
|---|---|---|
| eventName |
string
|
callback returns epoch seconds or -1 |
Returns: Promise<any>
eventGetOccurrences(eventName)
Get Event Number of Occurrences
| Param | Type | Details |
|---|---|---|
| eventName |
string
|
calls back with int or -1 |
Returns: Promise<any>
eventGetDetails(eventName)
Get Event Details