Skip to content

Commit f8ce6b6

Browse files
committed
refactor: add inAppConsume method to ReactIterableAPI and enhance Objective-C bridge for improved in-app consumption tracking functionality
1 parent 5ec2b31 commit f8ce6b6

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

ios/RNIterableAPI/RNIterableAPI.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ - (void)trackInAppClose:(NSString *)messageId
196196
[_swiftAPI trackInAppClose:messageId location:location source:source clickedUrl:clickedUrl];
197197
}
198198

199+
- (void)inAppConsume:(NSString *)messageId
200+
location:(NSNumber *)location
201+
source:(NSNumber *)source
202+
{
203+
NSLog(@"ReactNativeSdk inAppConsume");
204+
[_swiftAPI inAppConsume:messageId location:location source:source];
205+
}
206+
199207
@end
200208

201209

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ open class ReactIterableAPI: RCTEventEmitter {
274274
}
275275

276276
@objc(inAppConsume:location:source:)
277-
func inAppConsume(
277+
public func inAppConsume(
278278
messageId: String,
279279
location locationNumber: NSNumber,
280280
source sourceNumber: NSNumber

src/api/NativeRNIterableAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export interface Spec extends TurboModule {
7777
source: number,
7878
clickedUrl?: string
7979
): void;
80-
// inAppConsume(messageId: string, location: number, source: number): void;
80+
inAppConsume(messageId: string, location: number, source: number): void;
8181

8282
// // Commerce
8383
// updateCart(items: { [key: string]: string | number | boolean }[]): void;

src/core/classes/Iterable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ export class Iterable {
642642
) {
643643
Iterable?.logger?.log('inAppConsume');
644644

645-
RNIterableAPI.inAppConsume(message.messageId, location, source);
645+
api.inAppConsume(message.messageId, location, source);
646646
}
647647

648648
/**

0 commit comments

Comments
 (0)