export declare enum CustomEventTypes { screenView = "screenView" } export type Address = { region?: string | null; town?: string | null; address?: string | null; postcode?: string | null; }; type Field = { key: string; value: string; }; type Fields = Field[]; export type UserAttributes = { phone?: string | null; email?: string | null; firstName?: string | null; lastName?: string | null; languageCode?: string | null; timeZone?: string | null; address?: Address | null; fields?: Fields | null; }; export type AnonymousUserAttributes = Pick; export type User = { userAttributes?: UserAttributes | null; subscriptionKeys?: String[] | null; groupNamesInclude?: String[] | null; groupNamesExclude?: String[] | null; }; export type SetUserAttributesPayload = { externalUserId: string; user: User; }; export type CustomEventParameter = { name: string; value?: string; }; export type AppInboxStatus = 'OPENED' | 'UNOPENED'; export type GetAppInboxMessages = { page?: number; pageSize?: number; status?: AppInboxStatus; }; export type InAppDisplayData = { id?: string; source?: 'DISPLAY_RULES' | 'PUSH_NOTIFICATION'; }; export type InAppCloseData = { id?: string; source?: 'DISPLAY_RULES' | 'PUSH_NOTIFICATION'; closeAction?: 'OPEN_URL' | 'BUTTON' | 'CLOSE_BUTTON'; }; export type InAppErrorData = { id?: string; source?: 'DISPLAY_RULES' | 'PUSH_NOTIFICATION'; errorMessage?: string; }; export type InAppCustomData = { customData?: Record; inapp_id?: string; inapp_source?: 'DISPLAY_RULES' | 'PUSH_NOTIFICATION'; url?: string; }; export type RecommendationsPayload = { recomVariantId: string; productIds: string[]; categoryId: string; filters?: { [key: string]: any; }[]; fields: string[]; }; export type RecommendationEvent = { productId: string; }; export type RecommendationEventPayload = { recomVariantId: string; impressions: RecommendationEvent[]; clicks: RecommendationEvent[]; forcePush?: boolean; }; export type InboxMessage = { id: string; title: string; createdDate: string; imageURL?: string; linkURL?: string; isNew: boolean; content?: string; category?: string; status?: AppInboxStatus; }; export type UnreadMessagesCountData = { count: number; }; export type UnreadMessagesCountErrorData = { statusCode?: number | null; response?: string | null; error?: string | null; }; export type PushButton = { actionId: string; customData: string | null; actionLink: string | null; userInfo: any; }; export declare function setDeviceToken(deviceToken: string): Promise; export declare function setUserAttributes(payload: SetUserAttributesPayload): Promise; export declare function getInitialNotification(): Promise; export declare function getRecommendations(payload: RecommendationsPayload): Promise; export declare function logRecommendationEvent(payload: RecommendationEventPayload): Promise; /** * Initialize event handler. Call this after setting up all event listeners. * Events that occur before this call will be queued and delivered after initialization. * * @example * ```typescript * // 1. First, set up all your listeners * setOnRetenoPushReceivedListener((event) => { * console.log('Push received:', event); * }); * * // 2. Then initialize to start receiving events * initializeEventHandler(); * ``` * * @returns Promise that resolves to true when initialization is complete */ export declare function initializeEventHandler(): Promise; /** * Control whether SDK automatically opens URLs when user clicks on push notifications or in-app messages. * * @param enabled - true to auto-open URLs (default), false to handle URLs manually via event listeners * @returns Promise that resolves when setting is applied * * @example * ```typescript * // Disable automatic URL opening * setAutoOpenLinks(false); * * // Handle URLs manually * addInAppMessageCustomDataHandler((data) => { * if (data.url) { * // Custom URL handling logic * } * }); * ``` */ export declare function setAutoOpenLinks(enabled: boolean): Promise; /** * Get the current auto-open links setting. * * @returns Promise that resolves to the current setting (true = auto-open enabled, false = disabled) * * @example * ```typescript * const isEnabled = await getAutoOpenLinks(); * console.log('Auto open links:', isEnabled); * ``` */ export declare function getAutoOpenLinks(): Promise; export declare function setOnRetenoPushReceivedListener(listener: (event: any) => void): import("react-native").EmitterSubscription; export declare function setOnRetenoPushClickedListener(listener: (event: any) => void): import("react-native").EmitterSubscription; /** * iOS Only */ export declare function setOnRetenoPushButtonClickedListener(listener: (event: PushButton) => void): import("react-native").EmitterSubscription | undefined; export declare function setInAppLifecycleCallback(): void; /** * Android Only */ export declare function removeInAppLifecycleCallback(): void; export declare function beforeInAppDisplayHandler(callback: (data: InAppDisplayData) => void): import("react-native").EmitterSubscription; export declare function onInAppDisplayHandler(callback: (data: InAppDisplayData) => void): import("react-native").EmitterSubscription; export declare function beforeInAppCloseHandler(callback: (data: InAppCloseData) => void): import("react-native").EmitterSubscription; export declare function afterInAppCloseHandler(callback: (data: InAppCloseData) => void): import("react-native").EmitterSubscription; export declare function onInAppErrorHandler(callback: (data: InAppErrorData) => void): import("react-native").EmitterSubscription; export declare function addInAppMessageCustomDataHandler(callback: (data: InAppCustomData) => void): import("react-native").EmitterSubscription; /** * Log event * @param eventName name of the event * @param date date parameter should be in ISO8601 format, e.g new Date().toISOString() * @param parameters custom parameters * @param forcePush IOS force push */ export declare function logEvent(eventName: string, date: string, parameters: CustomEventParameter[], forcePush?: boolean): Promise; /** * IOS Only */ export declare function registerForRemoteNotifications(): void; export declare function setAnonymousUserAttributes(payload: AnonymousUserAttributes): Promise; export declare function pauseInAppMessages(isPaused: boolean): Promise; /** * * Reteno caches all events (events, device data, user information, user behavior, screen tracking, push statuses, etc) locally into database * Call this function to send all accumulated events */ export declare function forcePushData(): Promise; /** * Send log screen view event * @param screenName name of the screen */ export declare function logScreenView(screenName: string): Promise; /** * * Android only * * Since Android 13 was released you have to make sure you are handling Notification runtime permissions * * When user accepts permission, you have to call updatePushPermissionStatus() function from Reteno interface to notify the Reteno SDK that user has granted the permission. */ export declare function updatePushPermissionStatusAndroid(): Promise; export declare function getAppInboxMessages(payload: GetAppInboxMessages): Promise<{ messages: InboxMessage[]; totalPages: number; }>; export declare function onUnreadMessagesCountChanged(): void; /** * Android Only */ export declare function unsubscribeMessagesCountChanged(): void; /** * Android Only */ export declare function unsubscribeAllMessagesCountChanged(): void; export declare function unreadMessagesCountHandler(callback: (data: UnreadMessagesCountData) => void): import("react-native").EmitterSubscription; /** * Android Only */ export declare function unreadMessagesCountErrorHandler(callback: (data: UnreadMessagesCountErrorData) => void): import("react-native").EmitterSubscription | undefined; export declare function markAsOpened(messageIds: string[]): Promise<{ ids: string[]; status: string; } | UnreadMessagesCountErrorData>; export declare function markAllAsOpened(): Promise<{ status: string; } | UnreadMessagesCountErrorData>; export declare function getAppInboxMessagesCount(): Promise; export type EcomAttribute = { name: string; value: (string | null)[]; }; export type EcomSimpleAttribute = { name: string; value: string; }; export type EcomProductView = { productId: string; price: number; isInStock: boolean; attributes?: EcomAttribute[] | null; }; export type EcomCartItem = { productId: string; quantity: number; price: number; discount?: number | null; name?: string | null; category?: string | null; }; export declare enum OrderStatus { Initialized = 0, InProgress = 1, Delivered = 2, Cancelled = 3 } export type EcomOrder = { externalOrderId: string; externalCustomerId?: string | null; totalCost: number; status: OrderStatus; cartId?: string | null; email?: string | null; phone?: string | null; firstName?: string | null; lastName?: string | null; shipping?: number | null; discount?: number | null; taxes?: number | null; restoreId?: string | null; statusDescription?: string | null; storeId?: string | null; source?: string | null; deliveryMethod?: string | null; deliveryAddress?: string | null; paymentMethod?: string | null; orderItems?: EcomOrderItem[] | null; attributes?: EcomSimpleAttribute[] | null; }; export type EcomOrderItem = { externalItemId: string; name: string; category: string; quantity: number; price: number; url: string; imageUrl?: string | null; description?: string | null; }; export type EcomCategoryView = { productCategoryId: string; attributes?: EcomAttribute[] | null; }; export type EcomEventProductViewedPayload = { product: EcomProductView; currencyCode?: string | null; }; export declare function logEcomEventProductViewed(payload: EcomEventProductViewedPayload): Promise; /** * 2. Product Category Viewed Event */ export type EcomEventProductCategoryViewedPayload = { category: EcomCategoryView; }; export declare function logEcomEventProductCategoryViewed(payload: EcomEventProductCategoryViewedPayload): Promise; /** * 3. Product Added to Wishlist Event */ export type EcomEventProductAddedToWishlistPayload = { product: EcomProductView; currencyCode?: string | null; }; export declare function logEcomEventProductAddedToWishlist(payload: EcomEventProductAddedToWishlistPayload): Promise; /** * 4. Cart Updated Event */ export type EcomEventCartUpdatedPayload = { cartItems: EcomCartItem[]; currencyCode?: string | null; cartId: string; }; export declare function logEcomEventCartUpdated(payload: EcomEventCartUpdatedPayload): Promise; /** * 5. Order Created Event */ export type EcomEventOrderCreatedPayload = { order: EcomOrder; currencyCode?: string | null; }; export declare function logEcomEventOrderCreated(payload: EcomEventOrderCreatedPayload): Promise; /** * 6. Order Updated */ export type EcomEventOrderUpdatedPayload = { order: EcomOrder; currencyCode?: string | null; }; export declare function logEcomEventOrderUpdated(payload: EcomEventOrderUpdatedPayload): Promise; /** * 7. Order Delivered */ export type EcomEventOrderDeliveredPayload = { externalOrderId: string; }; export declare function logEcomEventOrderDelivered(payload: EcomEventOrderDeliveredPayload): Promise; /** * 8. Order Cancelled */ export type EcomEventOrderCancelledPayload = { externalOrderId: string; }; export declare function logEcomEventOrderCancelled(payload: EcomEventOrderCancelledPayload): Promise; /** * 9. Search Request Event */ export type EcomEventSearchRequestPayload = { searchQuery: string; isFound: boolean; }; export declare function logEcomEventSearchRequest(payload: EcomEventSearchRequestPayload): Promise; export {}; //# sourceMappingURL=index.d.ts.map