Skip to content

Commit

Permalink
Merge pull request #856 from Iterable/evan/MOB-10089
Browse files Browse the repository at this point in the history
[MOB-10089] renaming to setVisitorUsageTracked
  • Loading branch information
evantk91 authored Oct 30, 2024
2 parents d4cb261 + 23b6394 commit 1d56e8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions swift-sdk/Internal/InternalIterableAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,22 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
}
}

func setAnonymousUsageTracked(isAnonymousUsageTracked: Bool) {
func setVisitorUsageTracked(isVisitorUsageTracked: Bool) {
ITBInfo("CONSENT CHANGED - local events cleared")
self.localStorage.anonymousUsageTrack = isAnonymousUsageTracked
self.localStorage.anonymousUsageTrack = isVisitorUsageTracked
self.localStorage.anonymousUserEvents = nil
self.localStorage.anonymousSessions = nil
self.localStorage.anonymousUserUpdate = nil
self.localStorage.userIdAnnon = nil

if isAnonymousUsageTracked && config.enableAnonTracking {
if isVisitorUsageTracked && config.enableAnonTracking {
ITBInfo("CONSENT GIVEN and ANON TRACKING ENABLED - Criteria fetched")
self.anonymousUserManager.getAnonCriteria()
self.anonymousUserManager.updateAnonSession()
}
}

func getAnonymousUsageTracked() -> Bool {
func getVisitorUsageTracked() -> Bool {
return self.localStorage.anonymousUsageTrack
}

Expand Down
10 changes: 5 additions & 5 deletions swift-sdk/IterableAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ import UIKit
callback?(false)
}

if let implementation, config.enableAnonTracking, !implementation.isSDKInitialized(), implementation.getAnonymousUsageTracked() {
if let implementation, config.enableAnonTracking, !implementation.isSDKInitialized(), implementation.getVisitorUsageTracked() {
ITBInfo("AUT ENABLED AND CONSENT GIVEN - Criteria fetched")
implementation.anonymousUserManager.getAnonCriteria()
implementation.anonymousUserManager.updateAnonSession()
}
}

public static func setAnonymousUsageTracked(isAnonymousUsageTracked: Bool) {
public static func setVisitorUsageTracked(isVisitorUsageTracked: Bool) {
if let _implementation = implementation {
_implementation.setAnonymousUsageTracked(isAnonymousUsageTracked: isAnonymousUsageTracked)
_implementation.setVisitorUsageTracked(isVisitorUsageTracked: isVisitorUsageTracked)
}
}

public static func getAnonymousUsageTracked() -> Bool {
return implementation?.getAnonymousUsageTracked() ?? false
public static func getVisitorUsageTracked() -> Bool {
return implementation?.getVisitorUsageTracked() ?? false
}
// MARK: - SDK

Expand Down

0 comments on commit 1d56e8a

Please sign in to comment.