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