Skip to content

Commit 034fe43

Browse files
committed
feat: add start and end embedded session methods to ReactIterableAPI
1 parent 0894bad commit 034fe43

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

ios/RNIterableAPI/RNIterableAPI.mm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,14 @@ - (void)pauseAuthRetries:(BOOL)pauseRetry {
277277
[_swiftAPI pauseAuthRetries:pauseRetry];
278278
}
279279

280+
- (void)startEmbeddedSession {
281+
[_swiftAPI startEmbeddedSession];
282+
}
283+
284+
- (void)endEmbeddedSession {
285+
[_swiftAPI endEmbeddedSession];
286+
}
287+
280288
- (void)wakeApp {
281289
// Placeholder function -- this method is only used in Android
282290
}
@@ -507,6 +515,14 @@ - (void)wakeApp {
507515
[_swiftAPI pauseAuthRetries:pauseRetry];
508516
}
509517

518+
RCT_EXPORT_METHOD(startEmbeddedSession) {
519+
[_swiftAPI startEmbeddedSession];
520+
}
521+
522+
RCT_EXPORT_METHOD(endEmbeddedSession) {
523+
[_swiftAPI endEmbeddedSession];
524+
}
525+
510526
RCT_EXPORT_METHOD(wakeApp) {
511527
// Placeholder function -- this method is only used in Android
512528
}

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,20 @@ import React
493493
IterableAPI.pauseAuthRetries(pauseRetry)
494494
}
495495

496+
// MARK: - SDK Embedded Messaging Functions
497+
498+
@objc(startEmbeddedSession)
499+
public func startEmbeddedSession() {
500+
ITBInfo()
501+
EmbeddedSessionManager.shared.startSession()
502+
}
503+
504+
@objc(endEmbeddedSession)
505+
public func endEmbeddedSession() {
506+
ITBInfo()
507+
EmbeddedSessionManager.shared.endSession()
508+
}
509+
496510
// MARK: Private
497511
private var shouldEmit = false
498512
private let _methodQueue = DispatchQueue(label: String(describing: ReactIterableAPI.self))

0 commit comments

Comments
 (0)