Skip to content

AI_Index

Joseph Samir edited this page Jun 21, 2026 · 3 revisions

iOS SDK Wiki — AI Agent Index

This index helps AI agents find the right documentation page without reading the entire wiki. Read this file first, then load only the specific pages relevant to your task.

Page Origin

This wiki mirrors the other Convert SDK wikis (JavaScript, Android, PHP), adapted for Swift/iOS:

  • Cross-SDK concept docs (lowercase-hyphenated filenames) — the conceptual prose (how bucketing, rules, events, and the data model work) is shared across all Convert SDK wikis; code samples and SDK-specific mechanics here are Swift/iOS.
  • iOS-specific docs (CamelCase filenames) — written for this SDK only: quickstart, installation, initialization, configuration, return types, code examples, offline behaviour, tracking control, app privacy, Objective-C interop, and testing.

Getting Started

Page When to read
How Convert Works High-level overview of the Convert platform and SDKs
Architecture Overview System architecture, the two-target SPM split (ConvertSwiftSDKCore + ConvertSwiftSDK), data flow
Data Model Reference Entity relationships: Experience, Variation, Feature, Variable, Goal, Audience, Location
Quickstart Overview Cross-SDK quickstart concepts before the iOS-specific setup
Requirements & Constraints SDK limitations, environment requirements, known constraints

iOS SDK Reference

Page When to read
Quickstart Step-by-step iOS setup and first experiment
Installation Swift Package Manager / CocoaPods, platform floors, the privacy manifest
Initialization ConvertSwiftSDK(configuration:), ready(), direct-data mode, event subscription
Configuration Options Every ConvertConfiguration parameter and its default
Return Types & Models Swift models (Variation, Feature), enums (FeatureStatus, GoalDataKey, LogLevel), feature-variable accessors
Code Examples Complete Swift (async/await + completion-handler) examples for every method
Offline Behavior On-disk event queue, background URLSession delivery, network-aware flush
Tracking Control Consent: static config flag, per-call override, and the runtime setTrackingEnabled toggle
App Privacy & Data Collection Apple Privacy Manifest (PrivacyInfo.xcprivacy) + App Store privacy mapping
Objective-C Interop Using the SDK from Objective-C / completion-handler call sites

Core Concepts (Shared)

Page When to read
Experiences & Variations A/B test structure, variation assignment, activation
Feature Flags Feature flag evaluation, variable values, feature status
Bucketing Algorithm Hash-based assignment (MurmurHash3, seed 9999), traffic allocation, determinism
Rule Evaluation & Targeting Audience matching, location matching, scheduling rules
Segments Visitor segmentation logic and custom segments
Data Management Config store, decision store, entity lookups
Event System Event pub/sub, lifecycle hooks, the frozen SystemEvent set
API Communication & Tracking URLSession communication, config fetching, event delivery, queue management

How-To Guides (Shared)

Page When to read
Running Experiences Activate experiments, get variations for a visitor
Running Features Evaluate feature flags, get typed variable values
Tracking Conversions Goal tracking, conversion events, revenue data
Visitor Context & Properties Visitor identification, attributes, cross-session persistence
Persistent Storage The SDK's built-in Keychain / UserDefaults / file-store persistence
Troubleshooting Common issues, debugging, diagnostic steps

Contributing

Page When to read
Testing swift-testing / XCTest, direct-data mode, the seed-9999 parity suite

iOS-Specific Notes

Topic Key difference from the JS / Android SDKs
Initialization ConvertSwiftSDK(configuration: ConvertConfiguration(sdkKey:)) — a plain initializer, no builder; try await ready() (or a completion-handler overload) gates the first decision
Async model Swift async/await on a Sendable SDK; actor-isolated internals (no coroutines); completion-handler overloads for ready / runExperiences / setTrackingEnabled / isTrackingEnabled only
HTTP URLSession (config fetch + background-session event delivery)
Visitor persistence Auto-UUID in the Keychain (…AfterFirstUnlockThisDeviceOnly), never IDFA/IDFV; mirrored to UserDefaults
Config cache Last-good config cached to an Application-Support file for offline cold start
Offline queue On-disk coordinated file queue + background URLSession flush (no SQLite / WorkManager)
Return types Swift structs (Variation, Feature) and enums; variables as FeatureVariable with a typed variable(_:as:) accessor
Interop Swift-async-first; Objective-C / callback sites use the +Completion overloads (no Java)
Platforms iOS 15+ / macOS 12+ / tvOS 15+, Swift 6

Public API Surface (entry points)

ConvertSwiftSDK(configuration: ConvertConfiguration)   // or ConvertSwiftSDK(configData: Data)
  ConvertConfiguration: sdkKey / sdkKeySecret / environment / apiConfigEndpoint /
           apiTrackEndpoint / dataRefreshIntervalMs / eventsBatchSize /
           eventsReleaseIntervalMs / bucketingHashSeed / bucketingMaxTraffic /
           logLevel / networkTracking / networkCacheLevel /
           ruleKeysCaseSensitive / ruleNegation
ConvertSwiftSDK
  ├── try await ready()                            // + ready(completion:)
  ├── createContext() / createContext(visitorId:) / createContext(visitorId:attributes:)
  ├── on(_:callback:) async -> EventListenerToken / off(_:) async
  └── setTrackingEnabled(_:) async / isTrackingEnabled() async   // + completion overloads
ConvertContext
  ├── runExperience(_:enableTracking:) async -> Variation?
  ├── runExperiences(enableTracking:) async -> [Variation]        // + completion overload
  ├── runFeature(_:) async -> Feature / runFeatures() async -> [Feature]
  ├── trackConversion(_:goalData:forceMultipleTransactions:) async
  └── setDefaultSegments(_:) async / setCustomSegments(_:) async

Clone this wiki locally