Skip to content

Commit 081504b

Browse files
committed
chore: merge from master
2 parents 97f5a6c + 5b2ab42 commit 081504b

File tree

5 files changed

+604
-40
lines changed

5 files changed

+604
-40
lines changed

example/ios/ReactNativeSdkExample/Info.plist

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,5 @@
5252
</array>
5353
<key>UIViewControllerBasedStatusBarAppearance</key>
5454
<false/>
55-
<key>UIAppFonts</key>
56-
<array>
57-
<string>AntDesign.ttf</string>
58-
<string>Entypo.ttf</string>
59-
<string>EvilIcons.ttf</string>
60-
<string>Feather.ttf</string>
61-
<string>FontAwesome.ttf</string>
62-
<string>FontAwesome5_Brands.ttf</string>
63-
<string>FontAwesome5_Regular.ttf</string>
64-
<string>FontAwesome5_Solid.ttf</string>
65-
<string>FontAwesome6_Brands.ttf</string>
66-
<string>FontAwesome6_Regular.ttf</string>
67-
<string>FontAwesome6_Solid.ttf</string>
68-
<string>Foundation.ttf</string>
69-
<string>Ionicons.ttf</string>
70-
<string>MaterialIcons.ttf</string>
71-
<string>MaterialCommunityIcons.ttf</string>
72-
<string>SimpleLineIcons.ttf</string>
73-
<string>Octicons.ttf</string>
74-
<string>Zocial.ttf</string>
75-
<string>Fontisto.ttf</string>
76-
</array>
7755
</dict>
7856
</plist>

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@babel/core": "^7.25.2",
2626
"@babel/preset-env": "^7.25.3",
2727
"@babel/runtime": "^7.25.0",
28-
"@react-native-community/cli": "18.0.0",
28+
"@react-native-community/cli": "18.0.1",
2929
"@react-native-community/cli-platform-android": "18.0.0",
3030
"@react-native-community/cli-platform-ios": "18.0.0",
3131
"@react-native/babel-preset": "0.79.3",

src/__mocks__/MockRNIterableAPI.ts

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,28 @@ export class MockRNIterableAPI {
8686
});
8787
}
8888

89+
static async getInboxMessages(): Promise<IterableInAppMessage[] | undefined> {
90+
return await new Promise((resolve) => {
91+
// Filter messages that are marked for inbox
92+
const inboxMessages =
93+
MockRNIterableAPI.messages?.filter((msg) => msg.saveToInbox) || [];
94+
resolve(inboxMessages);
95+
});
96+
}
97+
98+
static async getHtmlInAppContentForMessage(
99+
messageId: string
100+
): Promise<unknown> {
101+
return await new Promise((resolve) => {
102+
// Mock HTML content for testing
103+
const mockHtmlContent = {
104+
edgeInsets: { top: 10, left: 20, bottom: 30, right: 40 },
105+
html: `<div>Mock HTML content for message ${messageId}</div>`,
106+
};
107+
resolve(mockHtmlContent);
108+
});
109+
}
110+
89111
static setAutoDisplayPaused = jest.fn();
90112

91113
static showMessage = jest.fn(
@@ -113,22 +135,12 @@ export class MockRNIterableAPI {
113135

114136
static updateSubscriptions = jest.fn();
115137

116-
static getInboxMessages = jest.fn(
117-
async (): Promise<IterableInAppMessage[] | undefined> => {
118-
return await new Promise((resolve) => {
119-
resolve(MockRNIterableAPI.messages);
120-
});
121-
}
122-
);
123-
124138
static startSession = jest.fn();
125139

126140
static endSession = jest.fn();
127141

128142
static updateVisibleRows = jest.fn();
129143

130-
static getHtmlInAppContentForMessage = jest.fn();
131-
132144
// set messages function is to set the messages static property
133145
// this is for testing purposes only
134146
static setMessages(messages: IterableInAppMessage[]): void {

0 commit comments

Comments
 (0)