Skip to content

Commit 4c5faf6

Browse files
committed
refactor: implement trackInAppClick method in ReactIterableAPI and enhance Objective-C bridge for improved in-app click tracking functionality
1 parent 747e4b9 commit 4c5faf6

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

ios/RNIterableAPI/RNIterableAPI.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ - (void)trackInAppOpen:(NSString *)messageId
179179
[_swiftAPI trackInAppOpen:messageId location:location];
180180
}
181181

182+
- (void)trackInAppClick:(NSString *)messageId
183+
location:(NSNumber *)location
184+
clickedUrl:(NSString *)clickedUrl
185+
{
186+
NSLog(@"ReactNativeSdk trackInAppClick");
187+
[_swiftAPI trackInAppClick:messageId location:location clickedUrl:clickedUrl];
188+
}
189+
182190
@end
183191

184192

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ open class ReactIterableAPI: RCTEventEmitter {
232232
}
233233

234234
@objc(trackInAppClick:location:clickedUrl:)
235-
func trackInAppClick(
235+
public func trackInAppClick(
236236
messageId: String,
237237
location locationNumber: NSNumber,
238238
clickedUrl: String
@@ -320,8 +320,8 @@ open class ReactIterableAPI: RCTEventEmitter {
320320
@objc(trackEvent:dataFields:)
321321
public func trackEvent(name: String, dataFields: NSDictionary?) {
322322
ITBInfo()
323-
324-
IterableAPI.track(event: name, dataFields: dataFields as? [AnyHashable : Any])
323+
324+
IterableAPI.track(event: name, dataFields: dataFields as? [AnyHashable: Any])
325325
}
326326

327327
@objc(updateUser:mergeNestedObjects:)

src/api/NativeRNIterableAPI.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ export interface Spec extends TurboModule {
6666
dataFields?: { [key: string]: string | number | boolean }
6767
): void;
6868
trackInAppOpen(messageId: string, location: number): void;
69-
// trackInAppClick(
70-
// messageId: string,
71-
// location: number,
72-
// clickedUrl: string
73-
// ): void;
69+
trackInAppClick(
70+
messageId: string,
71+
location: number,
72+
clickedUrl: string
73+
): void;
7474
// trackInAppClose(
7575
// messageId: string,
7676
// location: number,

src/core/classes/Iterable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ export class Iterable {
558558
) {
559559
Iterable?.logger?.log('trackInAppClick');
560560

561-
RNIterableAPI.trackInAppClick(message.messageId, location, clickedUrl);
561+
api.trackInAppClick(message.messageId, location, clickedUrl);
562562
}
563563

564564
/**

0 commit comments

Comments
 (0)