Skip to content

Commit 98149d9

Browse files
committed
refactor: update getHtmlInAppContent method to public in ReactIterableAPI and enhance Objective-C bridge for improved HTML content retrieval functionality
1 parent a9cc366 commit 98149d9

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

ios/RNIterableAPI/RNIterableAPI.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ - (void)getLastPushPayload:(RCTPromiseResolveBlock)resolve
258258
[_swiftAPI getLastPushPayload:resolve rejecter:reject];
259259
}
260260

261+
- (void)getHtmlInAppContentForMessage:(NSString *)messageId
262+
resolve:(RCTPromiseResolveBlock)resolve
263+
reject:(RCTPromiseRejectBlock)reject
264+
{
265+
NSLog(@"ReactNativeSdk getHtmlInAppContentForMessage");
266+
[_swiftAPI getHtmlInAppContentForMessage:messageId resolver:resolve rejecter:reject];
267+
}
261268

262269
@end
263270

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ open class ReactIterableAPI: RCTEventEmitter {
300300
}
301301

302302
@objc(getHtmlInAppContentForMessage:resolver:rejecter:)
303-
func getHtmlInAppContent(
303+
public func getHtmlInAppContent(
304304
messageId: String, resolver: RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock
305305
) {
306306
ITBInfo()

src/api/NativeRNIterableAPI.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ export interface Spec extends TurboModule {
108108
[key: string]: string | number | boolean;
109109
} | null>;
110110

111-
// // Content
112-
// getHtmlInAppContentForMessage(
113-
// messageId: string
114-
// ): Promise<{ [key: string]: string | number | boolean }>;
111+
// Content
112+
getHtmlInAppContentForMessage(
113+
messageId: string
114+
): Promise<{ [key: string]: string | number | boolean }>;
115115

116116
// // App links
117117
// handleAppLink(appLink: string): Promise<boolean>;

src/inApp/classes/IterableInAppManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class IterableInAppManager {
154154
): Promise<IterableHtmlInAppContent> {
155155
Iterable?.logger?.log('InAppManager.getHtmlContentForMessage');
156156

157-
return RNIterableAPI.getHtmlInAppContentForMessage(message.messageId);
157+
return api.getHtmlInAppContentForMessage(message.messageId);
158158
}
159159

160160
/**

src/inbox/classes/IterableInboxDataModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class IterableInboxDataModel {
103103
'IterableInboxDataModel.getHtmlContentForItem messageId: ' + id
104104
);
105105

106-
return RNIterableAPI.getHtmlInAppContentForMessage(id).then(
106+
return api.getHtmlInAppContentForMessage(id).then(
107107
(content: IterableHtmlInAppContentRaw) => {
108108
return IterableHtmlInAppContent.fromDict(content);
109109
}

0 commit comments

Comments
 (0)