Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ios/RNIterableAPI/RNIterableAPI.mm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ - (void)pauseAuthRetries:(BOOL)pauseRetry {
[_swiftAPI pauseAuthRetries:pauseRetry];
}

- (void)startEmbeddedSession {
[_swiftAPI startEmbeddedSession];
}

- (void)endEmbeddedSession {
[_swiftAPI endEmbeddedSession];
}

- (void)wakeApp {
// Placeholder function -- this method is only used in Android
}
Expand Down Expand Up @@ -507,6 +515,14 @@ - (void)wakeApp {
[_swiftAPI pauseAuthRetries:pauseRetry];
}

RCT_EXPORT_METHOD(startEmbeddedSession) {
[_swiftAPI startEmbeddedSession];
}

RCT_EXPORT_METHOD(endEmbeddedSession) {
[_swiftAPI endEmbeddedSession];
}

RCT_EXPORT_METHOD(wakeApp) {
// Placeholder function -- this method is only used in Android
}
Expand Down
14 changes: 14 additions & 0 deletions ios/RNIterableAPI/ReactIterableAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,20 @@ import React
IterableAPI.pauseAuthRetries(pauseRetry)
}

// MARK: - SDK Embedded Messaging Functions

@objc(startEmbeddedSession)
public func startEmbeddedSession() {
ITBInfo()
EmbeddedSessionManager.shared.startSession()
}

@objc(endEmbeddedSession)
public func endEmbeddedSession() {
ITBInfo()
EmbeddedSessionManager.shared.endSession()
}

// MARK: Private
private var shouldEmit = false
private let _methodQueue = DispatchQueue(label: String(describing: ReactIterableAPI.self))
Expand Down