UNPKG

react-native-notificare

Version:
40 lines (38 loc) 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NotificareEventsModule = void 0; var _reactNative = require("react-native"); const LINKING_ERROR = `The package 'react-native-notificare' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; // @ts-expect-error const isTurboModuleEnabled = global.__turboModuleProxy != null; const NotificareModule = isTurboModuleEnabled ? require('./NativeNotificareModule').default : _reactNative.NativeModules.NotificareModule; const NativeModule = NotificareModule ? NotificareModule : new Proxy({}, { get() { throw new Error(LINKING_ERROR); } }); class NotificareEventsModule { /** * Logs in Notificare a custom event in the application. * * This function allows logging, in Notificare, of application-specific events, * optionally associating structured data for more detailed event tracking and * analysis. * * @param {string} event - The name of the custom event to log. * @param {Record<string, any>} data - Optional structured event data for * further details. * @returns {Promise<void>} - A promise that resolves when the custom event * has been successfully logged. */ async logCustom(event, data) { await NativeModule.logCustom(event, data); } } exports.NotificareEventsModule = NotificareEventsModule; //# sourceMappingURL=notificare-events-module.js.map