Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion example/src/hooks/useIterableApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export const IterableAppProvider: FunctionComponent<
const [apiKey, setApiKey] = useState<string | undefined>(
process.env.ITBL_API_KEY
);
const [userId, setUserId] = useState<string | null>(process.env.ITBL_ID ?? null);
const [userId, setUserId] = useState<string | null>(
process.env.ITBL_ID ?? null
);
const [loginInProgress, setLoginInProgress] = useState<boolean>(false);

const getUserId = useCallback(() => userId ?? process.env.ITBL_ID, [userId]);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@
"commitlint": "^19.6.1",
"del-cli": "^5.1.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-tsdoc": "^0.3.0",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"prettier-eslint": "^16.4.2",
"react": "19.0.0",
"react-native": "0.79.3",
"react-native-builder-bob": "^0.40.4",
Expand Down
1 change: 0 additions & 1 deletion src/api/NativeRNIterableAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export interface Spec extends TurboModule {
// Wake app -- android only
wakeApp(): void;


// REQUIRED for RCTEventEmitter
addListener(eventName: string): void;
removeListeners(count: number): void;
Expand Down
40 changes: 29 additions & 11 deletions src/core/classes/Iterable.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* eslint-disable eslint-comments/no-unlimited-disable */
import {
Linking,
NativeEventEmitter,
Platform,
} from 'react-native';
import { Linking, NativeEventEmitter, Platform } from 'react-native';

import { buildInfo } from '../../itblBuildInfo';

Expand Down Expand Up @@ -361,7 +357,13 @@ export class Iterable {
Iterable?.logger?.log('getAttributionInfo');

return RNIterableAPI.getAttributionInfo().then(
(dict: { campaignId: number; templateId: number; messageId: string } | null) => {
(
dict: {
campaignId: number;
templateId: number;
messageId: string;
} | null
) => {
if (dict) {
return new IterableAttributionInfo(
dict.campaignId as number,
Expand Down Expand Up @@ -402,7 +404,11 @@ export class Iterable {
static setAttributionInfo(attributionInfo?: IterableAttributionInfo) {
Iterable?.logger?.log('setAttributionInfo');

RNIterableAPI.setAttributionInfo(attributionInfo as unknown as { [key: string]: string | number | boolean; } | null);
RNIterableAPI.setAttributionInfo(
attributionInfo as unknown as {
[key: string]: string | number | boolean;
} | null
);
}

/**
Expand Down Expand Up @@ -481,7 +487,9 @@ export class Iterable {
static updateCart(items: IterableCommerceItem[]) {
Iterable?.logger?.log('updateCart');

RNIterableAPI.updateCart(items as unknown as { [key: string]: string | number | boolean }[]);
RNIterableAPI.updateCart(
items as unknown as { [key: string]: string | number | boolean }[]
);
}

/**
Expand Down Expand Up @@ -533,7 +541,11 @@ export class Iterable {
) {
Iterable?.logger?.log('trackPurchase');

RNIterableAPI.trackPurchase(total, items as unknown as { [key: string]: string | number | boolean }[], dataFields as { [key: string]: string | number | boolean } | undefined);
RNIterableAPI.trackPurchase(
total,
items as unknown as { [key: string]: string | number | boolean }[],
dataFields as { [key: string]: string | number | boolean } | undefined
);
}

/**
Expand Down Expand Up @@ -702,7 +714,10 @@ export class Iterable {
static trackEvent(name: string, dataFields?: unknown) {
Iterable?.logger?.log('trackEvent');

RNIterableAPI.trackEvent(name, dataFields as { [key: string]: string | number | boolean } | undefined);
RNIterableAPI.trackEvent(
name,
dataFields as { [key: string]: string | number | boolean } | undefined
);
}

/**
Expand Down Expand Up @@ -750,7 +765,10 @@ export class Iterable {
) {
Iterable?.logger?.log('updateUser');

RNIterableAPI.updateUser(dataFields as { [key: string]: string | number | boolean }, mergeNestedObjects);
RNIterableAPI.updateUser(
dataFields as { [key: string]: string | number | boolean },
mergeNestedObjects
);
}

/**
Expand Down
Loading