Skip to content

Commit 5ec2b31

Browse files
committed
refactor: implement trackInAppClose method in ReactIterableAPI and enhance Objective-C bridge for improved in-app close tracking functionality
1 parent 4c5faf6 commit 5ec2b31

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

ios/RNIterableAPI/RNIterableAPI.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ - (void)trackInAppClick:(NSString *)messageId
187187
[_swiftAPI trackInAppClick:messageId location:location clickedUrl:clickedUrl];
188188
}
189189

190+
- (void)trackInAppClose:(NSString *)messageId
191+
location:(NSNumber *)location
192+
source:(NSNumber *)source
193+
clickedUrl:(NSString *)clickedUrl
194+
{
195+
NSLog(@"ReactNativeSdk trackInAppClose");
196+
[_swiftAPI trackInAppClose:messageId location:location source:source clickedUrl:clickedUrl];
197+
}
198+
190199
@end
191200

192201

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ open class ReactIterableAPI: RCTEventEmitter {
248248
}
249249

250250
@objc(trackInAppClose:location:source:clickedUrl:)
251-
func trackInAppClose(
251+
public func trackInAppClose(
252252
messageId: String,
253253
location locationNumber: NSNumber,
254254
source sourceNumber: NSNumber,

src/api/NativeRNIterableAPI.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ export interface Spec extends TurboModule {
7171
location: number,
7272
clickedUrl: string
7373
): void;
74-
// trackInAppClose(
75-
// messageId: string,
76-
// location: number,
77-
// source: number,
78-
// clickedUrl?: string
79-
// ): void;
74+
trackInAppClose(
75+
messageId: string,
76+
location: number,
77+
source: number,
78+
clickedUrl?: string
79+
): void;
8080
// inAppConsume(messageId: string, location: number, source: number): void;
8181

8282
// // Commerce

src/core/classes/Iterable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ export class Iterable {
591591
) {
592592
Iterable?.logger?.log('trackInAppClose');
593593

594-
RNIterableAPI.trackInAppClose(
594+
api.trackInAppClose(
595595
message.messageId,
596596
location,
597597
source,

0 commit comments

Comments
 (0)