react-native-kochava-measurement
Version:
A lightweight and easy to integrate SDK, providing first-class integration with Kochava’s installation attribution and analytics platform.
79 lines (78 loc) • 2.83 kB
TypeScript
import './polyfills/rn.js';
import 'whatwg-fetch';
import JobQueue from "./jobqueue";
import { KochavaMeasurementEvent, KochavaMeasurementEventType } from "./measurementEvent";
export { KochavaMeasurementEventType } from "./measurementEvent";
import { Json, Urls, CustomValue, KvConfig } from "./interfaces";
declare global {
interface Window {
kochava: Kochava;
}
}
export interface KochavaInstance {
appGuid: string;
started: boolean;
installStarted: boolean;
kvinitDone: boolean;
installDone: boolean;
disableAutoPage: boolean;
useCookies: boolean;
sleep: boolean;
version: string;
buildDate: string;
overrideUrls: Urls;
customValues: CustomValue[];
kochavaSession: string;
retryWaterfall: number[];
startTimeMS: number;
sdkDisabled: boolean;
utm: string;
installCount: number;
kochavaDeviceId: string;
kochavaInstallId: string;
kochavaInstallDate: number;
kochavaSessionCount: number;
kochavaConfig?: KvConfig;
}
export declare class Kochava {
_instance: KochavaInstance;
_jobQueue: JobQueue;
private constructor();
static create(): Kochava;
static createForReactNative(): Kochava;
static createForNode(): Kochava;
static createForReact(): Kochava;
static createForVue(): Kochava;
static createForAngular(): Kochava;
useCookies(condition?: boolean): void;
disableAutoPage(condition?: boolean): void;
buildEventWithEventType(type: KochavaMeasurementEventType): KochavaMeasurementEvent | undefined;
buildEventWithEventName(eventName: string): KochavaMeasurementEvent | undefined;
startWithAppGuid(appGuid: string): void;
private _startWithAppGuid;
shutdown(deleteData: boolean): void;
private _shutdown;
setLogLevel(logLevel: string): void;
executeAdvancedInstruction(key: string, valueStr: string, callback?: (input: string) => void): void;
sendEvent(name: string, data?: Json | string): void;
private _sendEvent;
sendPageEvent(pageName?: string, additionalData?: Json): void;
registerIdentityLink(name: string, identifier: string): void;
private _registerIdentityLink;
registerCustomValue(name: string, value: string): void;
registerCustomDeviceIdentifier(name: string, value: string): void;
getStarted(): boolean;
getDeviceId(): string;
setSleep(sleep: boolean): Promise<void>;
private _setSleep;
_resetInstance(): void;
_initInstance(appGuid: string): void;
_checkFirstLaunchAndMigrate(): Promise<void>;
_checkPersistedKvinit(): Promise<void>;
_checkPersistedState(): Promise<void>;
_printStartupMsgs(appGuid: string): void;
_beginStart(): Promise<void>;
performNewKvinit(): Promise<void>;
checkResendId(): Promise<boolean>;
performInstall(): Promise<void>;
}