Skip to content

Privacy and tracking controls

The SDK exposes a GDPR event class that sends a “forget me” signal to the Affise backend: @objc public class GDPREvent : NativeEvent with static let EVENT_NAME = "GDPR" (AffiseAttributionLib/Classes/events/predefined/GDPREvent.swift:10-14).

Since GDPREvent subclasses NativeEvent, you can instantiate and send it like any other event:

GDPREvent(/* optional userData */)
.send()

See Events for parameter and send-control details.

Two @objc public static toggles control whether the SDK may collect and forward data at all:

@objc public static func setTrackingEnabled(_ enabled: Bool)
@objc public static func isTrackingEnabled() -> Bool

AffiseAttributionLib/Classes/Affise.swift:115-126.

When tracking is disabled, the SDK raises AffiseError.trackingDisabledException internally (AffiseAttributionLib/Classes/errors/AffiseError.swift:3).

Independently toggle whether the SDK is allowed to perform network activity while the app is in the background:

@objc public static func setBackgroundTrackingEnabled(_ enabled: Bool)
@objc public static func isBackgroundTrackingEnabled() -> Bool

AffiseAttributionLib/Classes/Affise.swift:97-108.

When disabled, the SDK raises AffiseError.backgroundTrackingDisabledException (AffiseAttributionLib/Classes/errors/AffiseError.swift:3).

  • Offline mode — buffer events while the device is intentionally offline.