Skip to content

Commit 7e6f6e4

Browse files
committed
chore: upgrade React, React Native, and related packages to versions 19.2.3 and 0.84.1
1 parent a135387 commit 7e6f6e4

8 files changed

Lines changed: 283 additions & 308 deletions

File tree

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
mavenCentral()
1313
}
1414
dependencies {
15-
classpath('com.android.tools.build:gradle:8.7.2')
15+
classpath("com.android.tools.build:gradle")
1616
classpath("com.facebook.react:react-native-gradle-plugin")
1717
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
1818
}

example/ios/ReactNativeSdkExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,11 @@
442442
);
443443
PRODUCT_BUNDLE_IDENTIFIER = iterable.reactnativesdk.example;
444444
PRODUCT_NAME = ReactNativeSdkExample;
445+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
445446
SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeSdkExample-Bridging-Header.h";
446447
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
447448
SWIFT_VERSION = 5.0;
449+
TARGETED_DEVICE_FAMILY = "1,2";
448450
VERSIONING_SYSTEM = "apple-generic";
449451
};
450452
name = Debug;
@@ -472,8 +474,10 @@
472474
);
473475
PRODUCT_BUNDLE_IDENTIFIER = iterable.reactnativesdk.example;
474476
PRODUCT_NAME = ReactNativeSdkExample;
477+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
475478
SWIFT_OBJC_BRIDGING_HEADER = "ReactNativeSdkExample-Bridging-Header.h";
476479
SWIFT_VERSION = 5.0;
480+
TARGETED_DEVICE_FAMILY = "1,2";
477481
VERSIONING_SYSTEM = "apple-generic";
478482
};
479483
name = Release;

example/ios/ReactNativeSdkExample/Info.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@
5050
<key>UISupportedInterfaceOrientations</key>
5151
<array>
5252
<string>UIInterfaceOrientationPortrait</string>
53+
</array>
54+
<key>UISupportedInterfaceOrientations~ipad</key>
55+
<array>
5356
<string>UIInterfaceOrientationLandscapeLeft</string>
5457
<string>UIInterfaceOrientationLandscapeRight</string>
58+
<string>UIInterfaceOrientationPortrait</string>
59+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
5560
</array>
5661
<key>UIViewControllerBasedStatusBarAppearance</key>
5762
<false/>

example/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"@react-navigation/native": "^7.1.14",
1515
"@react-navigation/native-stack": "^7.0.0",
1616
"@react-navigation/stack": "^7.4.2",
17-
"react": "19.2.0",
18-
"react-native": "0.83.9",
17+
"react": "19.2.3",
18+
"react-native": "0.84.1",
1919
"react-native-gesture-handler": "^2.30.0",
2020
"react-native-safe-area-context": "^5.6.0",
2121
"react-native-screens": ">=4.19.0 <4.25.0",
@@ -25,21 +25,21 @@
2525
"@babel/core": "^7.25.2",
2626
"@babel/preset-env": "^7.25.3",
2727
"@babel/runtime": "^7.25.0",
28-
"@react-native-community/cli": "20.0.0",
29-
"@react-native-community/cli-platform-android": "20.0.0",
30-
"@react-native-community/cli-platform-ios": "20.0.0",
31-
"@react-native/babel-preset": "0.83.9",
32-
"@react-native/eslint-config": "0.83.9",
33-
"@react-native/metro-config": "0.83.9",
34-
"@react-native/typescript-config": "0.83.9",
28+
"@react-native-community/cli": "20.1.0",
29+
"@react-native-community/cli-platform-android": "20.1.0",
30+
"@react-native-community/cli-platform-ios": "20.1.0",
31+
"@react-native/babel-preset": "0.84.1",
32+
"@react-native/eslint-config": "0.84.1",
33+
"@react-native/metro-config": "0.84.1",
34+
"@react-native/typescript-config": "0.84.1",
3535
"@types/jest": "^29.5.13",
3636
"@types/react": "^19.2.0",
3737
"@types/react-test-renderer": "^19.1.0",
3838
"react-native-builder-bob": "^0.30.2",
3939
"react-native-dotenv": "^3.4.11",
40-
"react-test-renderer": "19.2.0"
40+
"react-test-renderer": "19.2.3"
4141
},
4242
"engines": {
43-
"node": ">=20"
43+
"node": ">= 22.11.0"
4444
}
4545
}

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@
6969
"devDependencies": {
7070
"@commitlint/config-conventional": "^19.6.0",
7171
"@evilmartians/lefthook": "^1.5.0",
72-
"@react-native-community/cli": "20.0.0",
73-
"@react-native/babel-preset": "0.83.9",
74-
"@react-native/eslint-config": "0.83.9",
75-
"@react-native/metro-config": "0.83.9",
76-
"@react-native/typescript-config": "0.83.9",
72+
"@react-native-community/cli": "20.1.0",
73+
"@react-native/babel-preset": "0.84.1",
74+
"@react-native/eslint-config": "0.84.1",
75+
"@react-native/metro-config": "0.84.1",
76+
"@react-native/typescript-config": "0.84.1",
7777
"@react-navigation/native": "^7.1.14",
7878
"@release-it/conventional-changelog": "^9.0.4",
7979
"@testing-library/jest-native": "^5.4.3",
@@ -93,14 +93,14 @@
9393
"jest": "^29.7.0",
9494
"prettier": "^3.0.3",
9595
"prettier-eslint": "^16.4.2",
96-
"react": "19.2.0",
97-
"react-native": "0.83.9",
96+
"react": "19.2.3",
97+
"react-native": "0.84.1",
9898
"react-native-builder-bob": "^0.40.4",
9999
"react-native-gesture-handler": "^2.30.0",
100100
"react-native-safe-area-context": "^5.6.0",
101101
"react-native-screens": ">=4.19.0 <4.25.0",
102102
"react-native-webview": "^13.14.1",
103-
"react-test-renderer": "19.2.0",
103+
"react-test-renderer": "19.2.3",
104104
"release-it": "^17.10.0",
105105
"turbo": "^1.10.7",
106106
"typedoc": "^0.28.13",

src/api/NativeRNIterableAPI.ts

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,20 @@ import { TurboModuleRegistry } from 'react-native';
33

44
// NOTE: No types can be imported because of the way new arch works, so we have
55
// to re-define the types here.
6-
interface EmbeddedMessage {
7-
metadata: {
8-
messageId: string;
9-
placementId: number;
10-
campaignId?: number | null;
11-
isProof?: boolean;
12-
};
13-
elements: {
14-
buttons?:
15-
| {
16-
id: string;
17-
title?: string | null;
18-
action: { type: string; data?: string } | null;
19-
}[]
20-
| null;
21-
body?: string | null;
22-
mediaUrl?: string | null;
23-
mediaUrlCaption?: string | null;
24-
defaultAction?: { type: string; data?: string } | null;
25-
text?: { id: string; text?: string | null; label?: string | null }[] | null;
26-
title?: string | null;
27-
} | null;
28-
payload?: { [key: string]: string | number | boolean | null } | null;
29-
}
30-
6+
// Codegen (RN 0.84+) rejects unions that include array types (e.g. `T[] | U`,
7+
// `string | string[]`). Use `Object` / `unknown` where the bridge carries
8+
// richer JSON than the parser allows.
319
export interface Spec extends TurboModule {
3210
// Initialization
3311
initializeWithApiKey(
3412
apiKey: string,
35-
config: { [key: string]: string | number | boolean | undefined | string[] },
13+
config: object,
3614
version: string
3715
): Promise<boolean>;
3816

3917
initialize2WithApiKey(
4018
apiKey: string,
41-
config: { [key: string]: string | number | boolean | undefined | string[] },
19+
config: object,
4220
version: string,
4321
apiEndPointOverride: string
4422
): Promise<boolean>;
@@ -122,12 +100,13 @@ export interface Spec extends TurboModule {
122100
// App links
123101
handleAppLink(appLink: string): Promise<boolean>;
124102

125-
// Subscriptions
103+
// Subscriptions (arrays only in spec — RN codegen rejects `T[] | null`; callers
104+
// may still pass null at the bridge when using typed assertions.)
126105
updateSubscriptions(
127-
emailListIds: number[] | null,
128-
unsubscribedChannelIds: number[] | null,
129-
unsubscribedMessageTypeIds: number[] | null,
130-
subscribedMessageTypeIds: number[] | null,
106+
emailListIds: number[],
107+
unsubscribedChannelIds: number[],
108+
unsubscribedMessageTypeIds: number[],
109+
subscribedMessageTypeIds: number[],
131110
campaignId: number,
132111
templateId: number
133112
): void;
@@ -151,11 +130,9 @@ export interface Spec extends TurboModule {
151130
endEmbeddedSession(): void;
152131
startEmbeddedImpression(messageId: string, placementId: number): void;
153132
pauseEmbeddedImpression(messageId: string): void;
154-
getEmbeddedMessages(
155-
placementIds: number[] | null
156-
): Promise<EmbeddedMessage[]>;
133+
getEmbeddedMessages(placementIds: number[]): Promise<object[]>;
157134
trackEmbeddedClick(
158-
message: EmbeddedMessage,
135+
message: object,
159136
buttonId: string | null,
160137
clickedUrl: string | null
161138
): void;

src/core/classes/IterableApi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ export class IterableApi {
560560
placementIds: number[] | null
561561
): Promise<IterableEmbeddedMessage[]> {
562562
IterableLogger.log('getEmbeddedMessages: ', placementIds);
563-
return RNIterableAPI.getEmbeddedMessages(placementIds);
563+
return RNIterableAPI.getEmbeddedMessages(placementIds as number[]);
564564
}
565565

566566
/**
@@ -647,10 +647,10 @@ export class IterableApi {
647647
templateId
648648
);
649649
return RNIterableAPI.updateSubscriptions(
650-
emailListIds,
651-
unsubscribedChannelIds,
652-
unsubscribedMessageTypeIds,
653-
subscribedMessageTypeIds,
650+
emailListIds as number[],
651+
unsubscribedChannelIds as number[],
652+
unsubscribedMessageTypeIds as number[],
653+
subscribedMessageTypeIds as number[],
654654
campaignId,
655655
templateId
656656
);

0 commit comments

Comments
 (0)