appmetrica-capacitor7
Version:
Appmetrica capacitor plugin
60 lines • 1.97 kB
JavaScript
import { registerPlugin } from '@capacitor/core';
const CapacitorAppmetrica = registerPlugin('Appmetrica', {
// web: () => import('./web').then(m => new m.AppmetricaWeb()),
});
export * from './definitions';
export * from './profile';
export class Appmetrica {
constructor() {
this.appmetrica = CapacitorAppmetrica;
}
activate(apiKey, options = {}) {
return this.appmetrica.activate(Object.assign({ apiKey }, options));
}
pauseSession() {
return this.appmetrica.pauseSession();
}
sendEventsBuffer() {
return this.appmetrica.sendEventsBuffer();
}
resumeSession() {
return this.appmetrica.resumeSession();
}
setLocationTracking(enabled) {
return this.appmetrica.setLocationTracking({ enabled });
}
setStatisticsSending(enabled) {
return this.appmetrica.setStatisticsSending({ enabled });
}
setLocation(location) {
return this.appmetrica.setLocation({ location });
}
reportAppOpen(url) {
return this.appmetrica.reportAppOpen({ url });
}
reportError(identifier, message, parameters) {
return this.appmetrica.reportError({ identifier, message, parameters });
}
reportEvent(name, parameters) {
return this.appmetrica.reportEvent({ name, parameters });
}
reportReferralUrl(referralUrl) {
return this.appmetrica.reportReferralUrl({ referralUrl });
}
setUserProfileID(id) {
return this.appmetrica.setUserProfileID({ id });
}
getDeviceID() {
return this.appmetrica.getDeviceID().then(({ deviceID }) => deviceID);
}
reportUserProfile(profile) {
const updates = profile.updates.map(m => ({
attributeName: m.attributeName,
methodName: m.methodName,
key: m.key,
values: m.values,
}));
return this.appmetrica.reportUserProfile({ updates });
}
}
//# sourceMappingURL=index.js.map