react-native-kochava-measurement
Version:
A lightweight and easy to integrate SDK, providing first-class integration with Kochava’s installation attribution and analytics platform.
130 lines (128 loc) • 4.21 kB
JavaScript
;
import { KochavaMeasurementDeeplink, KochavaMeasurementInstallAttribution } from "react-native-kochava-measurement";
import { Kochava } from "./web/kochava.js";
/**
* Implementation for web platforms. This includes pure web and Vega platforms.
*/
export class KochavaMeasurementImpl {
constructor() {
// Create the Kochava instance for React
this.kochava = Kochava.createForReactNative();
}
executeAdvancedInstruction(name, value) {
this.kochava.executeAdvancedInstruction(name, value);
}
setLogLevel(logLevel) {
this.kochava.setLogLevel(logLevel);
}
setSleep(enabled) {
this.kochava.setSleep(enabled);
}
setAppLimitAdTracking(_enabled) {
// Not implemented (no-op) on this platform
}
registerCustomDeviceIdentifier(name, value) {
this.kochava.registerCustomDeviceIdentifier(name, value);
}
registerCustomStringValue(_name, _value) {
// Not implemented (no-op) on this platform
}
registerCustomBoolValue(_name, _value) {
// Not implemented (no-op) on this platform
}
registerCustomNumberValue(_name, _value) {
// Not implemented (no-op) on this platform
}
registerIdentityLink(name, value) {
this.kochava.registerIdentityLink(name, value);
}
enableAppleAppClips(_identifier) {
// Not implemented (no-op) on this platform
}
enableAppleAtt() {
// Not implemented (no-op) on this platform
}
setAppleAttAuthorizationWaitTime(_timeInterval) {
// Not implemented (no-op) on this platform
}
setAppleAttAuthorizationAutoRequest(_enabled) {
// Not implemented (no-op) on this platform
}
setAppleAttAuthorizationCustomPrompt(_enabled) {
// Not implemented (no-op) on this platform
}
appleAttAuthorizationCustomPromptDidComplete() {
// Not implemented (no-op) on this platform
}
registerPrivacyProfile(_name, _keys) {
// Not implemented (no-op) on this platform
}
setPrivacyProfileEnabled(_name, _enabled) {
// Not implemented (no-op) on this platform
}
setConfigCompletedListener(_configCompletedListener) {
// Not implemented (no-op) on this platform
}
setIntelligentConsentGranted(_granted) {
// Not implemented (no-op) on this platform
}
getStarted() {
return Promise.resolve(this.kochava.getStarted());
}
start(parameters) {
// Extract the webAppGuid from parameters
const vegaAppGuid = parameters.vegaAppGuid;
this.kochava.disableAutoPage(true);
// Attempt to start regardless of if an app guid was provided so we get the SDK log messages.
this.kochava.startWithAppGuid(vegaAppGuid ?? "");
}
shutdown(deleteData) {
this.kochava.shutdown(deleteData);
}
retrieveInstallId() {
return Promise.resolve(this.kochava.getDeviceId());
}
retrieveInstallAttribution() {
// Not implemented (no-op) on this platform
return Promise.resolve(new KochavaMeasurementInstallAttribution(null));
}
processDeeplink(_path) {
// Not implemented (no-op) on this platform
return Promise.resolve(new KochavaMeasurementDeeplink(null));
}
processDeeplinkWithOverrideTimeout(_path, _timeout) {
// Not implemented (no-op) on this platform
return Promise.resolve(new KochavaMeasurementDeeplink(null));
}
registerDeeplinkWrapperDomain(_domain) {
// Not implemented (no-op) on this platform
}
registerDefaultEventStringParameter(_name, _value) {
// Not implemented (no-op) on this platform
}
registerDefaultEventBoolParameter(_name, _value) {
// Not implemented (no-op) on this platform
}
registerDefaultEventNumberParameter(_name, _value) {
// Not implemented (no-op) on this platform
}
registerDefaultEventUserId(_value) {
// Not implemented (no-op) on this platform
}
sendEvent(name) {
this.kochava.sendEvent(name);
}
sendEventWithString(name, data) {
this.kochava.sendEvent(name, data);
}
sendEventWithDictionary(name, data) {
this.kochava.sendEvent(name, data);
}
sendEventWithEvent(event) {
const data = event.getData();
const eventName = data.eventName;
const eventData = data.eventData;
this.kochava.sendEvent(eventName, eventData);
}
}
//# sourceMappingURL=KochavaMeasurementImpl.web.js.map