Skip to content

Commit 1b1baae

Browse files
committed
Merge branch 'feature/itbl_track_anon_user-consent' of github.com:Iterable/iterable-swift-sdk into feature/itbl_track_anon_user-consent
2 parents 002b34b + c0121a6 commit 1b1baae

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,17 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
271271
return self.localStorage.anonymousUsageTrack
272272
}
273273

274-
/// Sends consent data for replay scenarios when user signs up/in but didn't meet criteria
274+
/// Sends consent data for replay scenarios.
275+
///
276+
/// A "replay scenario" occurs when a user signs up or logs in but does not meet the criteria
277+
/// for immediate consent tracking. This method ensures that consent data is sent retroactively
278+
/// if the following conditions are met:
279+
/// - A consent timestamp exists (`visitorConsentTimestamp` is not nil).
280+
/// - No anonymous user ID is present (`userIdAnnon` is nil).
281+
/// - Anonymous usage tracking is enabled (`anonymousUsageTrack` is true).
282+
///
283+
/// This method is typically called during user sign-up or sign-in processes to ensure that
284+
/// consent data is properly recorded for compliance and analytics purposes.
275285
private func sendConsentForReplayScenario(email: String?, userId: String?) {
276286
guard let consentTimestamp = localStorage.visitorConsentTimestamp else {
277287
return

tests/unit-tests/ConsentTrackingTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// ConsentTrackingTests.swift
33
// swift-sdk
44
//
5-
// Created by Anonymous User Activation on 23/01/2025.
5+
// Created by Iterable Team on 23/01/2025.
66
// Copyright © 2025 Iterable. All rights reserved.
77
//
88

0 commit comments

Comments
 (0)