Skip to content

Commit 9fe5d8f

Browse files
committed
🔧 Fixed replay logic
1 parent 0aedce3 commit 9fe5d8f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
161161
isEmail: true,
162162
failureHandler: failureHandler
163163
)
164-
// Send consent for replay scenario if user didn't meet criteria but had consent
165-
self?.sendConsentForReplayScenario(email: email, userId: nil)
164+
// Send consent for replay scenario only if replay events is enabled
165+
if let replay, replay {
166+
self?.sendConsentForReplayScenario(email: email, userId: nil)
167+
}
166168

167169
self?.localStorage.userIdAnnon = nil
168170
}
@@ -206,8 +208,10 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
206208
isEmail: false,
207209
failureHandler: failureHandler
208210
)
209-
// Send consent for replay scenario if user didn't meet criteria but had consent
210-
self?.sendConsentForReplayScenario(email: nil, userId: userId)
211+
// Send consent for replay scenario only if replay events is enabled
212+
if let replay, replay {
213+
self?.sendConsentForReplayScenario(email: nil, userId: userId)
214+
}
211215
}
212216

213217
if !isAnon {

0 commit comments

Comments
 (0)