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 sync
API
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>
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('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> |
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'