Implements CleverTap SDK
npm install capacitor-clevertapThis plugin partially implements CleverTapAnalytics SDK. It's still under development and has many missing functions.
Follow iOS and Android initial setup instructions.
``bash`
npm install capacitor-clevertap
npx cap sync
* profileGetID()
* recordEvent(...)
* recordChargedEvent(...)
* profileIncrementValue(...)
* profilePush(...)
* setLocation(...)
* setPushTokenAs(...)
* onUserLogin(...)
* stopGeofence()
* initGeofence()
* triggerLocation()
* setDebugLevel(...)
* addListener('geofenceInitializedListener', ...)
* addListener('locationUpdateListener', ...)
* addListener('onPushClicked', ...)
* addListener('geofenceEnteredListener', ...)
* addListener('geofenceExitedListener', ...)
* checkPermissions()
* requestPermissions()
* Interfaces
* Type Aliases
* Enums
`typescript`
profileGetID() => Promise<{ id: string; }>
Returns: Promise<{ id: string; }>
--------------------
`typescript`
recordEvent(props: { event: string; properties: any; }) => Promise
| Param | Type |
| ----------- | ------------------------------------------------ |
| props | { event: string; properties: any; } |
--------------------
`typescript`
recordChargedEvent(props: { details: any; items: any[]; }) => Promise
| Param | Type |
| ----------- | -------------------------------------------- |
| props | { details: any; items: any[]; } |
--------------------
`typescript`
profileIncrementValue(props: { key: string; value: number; }) => Promise
| Param | Type |
| ----------- | -------------------------------------------- |
| props | { key: string; value: number; } |
--------------------
`typescript`
profilePush(props: { profileProperties: any; }) => Promise
| Param | Type |
| ----------- | ---------------------------------------- |
| props | { profileProperties: any; } |
--------------------
`typescript`
setLocation(props: { lat: number; lng: number; }) => Promise
| Param | Type |
| ----------- | ------------------------------------------ |
| props | { lat: number; lng: number; } |
--------------------
`typescript`
setPushTokenAs(props: { token: string; }) => Promise
| Param | Type |
| ----------- | ------------------------------- |
| props | { token: string; } |
--------------------
`typescript`
onUserLogin(props: { profileProperties: any; }) => Promise
| Param | Type |
| ----------- | ---------------------------------------- |
| props | { profileProperties: any; } |
--------------------
`typescript`
stopGeofence() => Promise
--------------------
`typescript`
initGeofence() => Promise
--------------------
`typescript`
triggerLocation() => Promise
--------------------
`typescript`
setDebugLevel(props: { level: DEBUG_LEVEL; }) => Promise
| Param | Type |
| ----------- | --------------------------------------------------------------- |
| props | { level: DEBUG_LEVEL; } |
--------------------
`typescript`
addListener(eventName: 'geofenceInitializedListener', listenerFunc: (event: { status: string; }) => void) => Promise
| Param | Type |
| ------------------ | ---------------------------------------------------- |
| eventName | 'geofenceInitializedListener' |
| listenerFunc | (event: { status: string; }) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'locationUpdateListener', listenerFunc: (event: { lat: number; lng: number; }) => void) => Promise
| Param | Type |
| ------------------ | -------------------------------------------------------------- |
| eventName | 'locationUpdateListener' |
| listenerFunc | (event: { lat: number; lng: number; }) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'onPushClicked', listenerFunc: (data: CleverTapPushNotificationPayload) => void) => Promise
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| eventName | 'onPushClicked' |
| listenerFunc | (data: CleverTapPushNotificationPayload) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'geofenceEnteredListener', listenerFunc: (event: GeofenceStatusChange) => void) => Promise
| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------------- |
| eventName | 'geofenceEnteredListener' |
| listenerFunc | (event: GeofenceStatusChange) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'geofenceExitedListener', listenerFunc: (event: GeofenceStatusChange) => void) => Promise
| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------------- |
| eventName | 'geofenceExitedListener' |
| listenerFunc | (event: GeofenceStatusChange) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
checkPermissions() => Promise<{ location: PermissionState; backgroundUpdate: PermissionState; }>
Returns: Promise<{ location: PermissionState; backgroundUpdate: PermissionState; }>
--------------------
`typescript`
requestPermissions() => Promise
--------------------
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
#### CleverTapPushNotificationPayload
| Prop | Type |
| ----------- | ------------------- |
| title | string |
| body | string |
| data | any |
| image | string |
#### GeofenceStatusChange
| Prop | Type |
| ------------------- | ------------------- |
| id | number |
| gcId | number |
| gcName | string |
| lat | number |
| lng | number |
| r | number |
| triggered_lat | number |
| triggered_lng | number |
#### PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
#### DEBUG_LEVEL
| Members | Value |
| ------------- | --------------- |
| OFF | -1 |
| INFO | 0 |
| DEBUG | 2 |
| VERBOSE` | 3 |