iOS SDK · Preview
Consent and privacy
Connect your consent dialog, manage purpose-level decisions and control advertising identifiers on iOS.
Preview: planned API
The iOS SDK is in development and not published yet. This page describes the API we are building so you can plan your integration. Package names, signatures and defaults may still change before the first release.
Without a stored decision or a consent option the SDK starts as granted, like the Web SDK. If you ask for consent first, initialize with a pending state and update it when the customer decides. Decisions are stored on the device.
// When the visitor decides in your consent dialog
RTN.setConsent(.granted)
// Purpose-level decisions
RTN.setConsentPurpose(.advertising, .granted)
let ads = RTN.getConsentPurpose(.advertising)
// Stop and restart collection without losing identity
RTN.pause()
RTN.resume()Consent purposes
| Purpose | Controls |
|---|---|
analytics | Event collection and delivery. Set by setConsent. |
personalization | Using events for personalized messages and recommendations |
advertising | Advertising identifiers and syncing the customer to ad audiences |
audiences | Including the customer in segments shared with ad platforms |
probabilistic_attribution | Matching installs without a deterministic identifier |
While analytics is pending, events are kept on the device and sent once it is granted. When it is denied, queued events are deleted and nothing is collected.
Advertising identifiers
The SDK never shows the App Tracking Transparency prompt on its own. Call RTN.requestTrackingAuthorization() at a moment that makes sense in your app; the IDFA is read only when the user allows tracking and the advertising purpose is granted. The SDK ships a privacy manifest (PrivacyInfo.xcprivacy) that declares the data it collects.
let status = await RTN.requestTrackingAuthorization()
// .authorized, .denied, .restricted or .notDeterminedData deletion
reset clears the known customer and starts a new anonymous identity on the device. To erase a customer's data, use the deletion request in the dashboard or the server API; the SDK does not delete server-side data.