Documentation Index
Fetch the complete documentation index at: https://docs.appstack.tech/llms.txt
Use this file to discover all available pages before exploring further.
Use Cursor, Claude Code, or another AI to help you integrate the Swift SDK.
Appstack ID and attribution params
Afterconfigure, you can read the Appstack user ID and the attribution map for partner integrations (for example Superwall, RevenueCat).
getAppstackId()— Appstack user identifier when a partner expects$appstackIdor similar.getAttributionParams()— Attribution payload (campaign, media source, click IDs, device identifiers where available) to forward to partners.
GitHub repository
Here, you will find the GitHub iOS Appstack SDK documentation. Please use the latest available version of the SDK.Requirements
- iOS 13.0+
- Xcode 14.0+
- Swift 5.0+
Initial setup
Installation
You can install the SDK via Swift Package Manager (SPM) by adding the following dependency to your Or directly from Xcode:
Package.swift file:- Go to File > Add Packages.
- Enter the repository URL:
https://github.com/appstack-tech/ios-appstack-sdk.git. - Select the desired version and click Add Package.
Initialization
Follow these steps to get the API key:SceneDelegateSwiftUI
- In Appstack, from the side menu, select SDK and ensure you are selecting the correct application.
- Select the Production environment.
- Copy the API key.
Configuration parameters
The AppstackAttributionSdk.shared.configure() method supports the following parameters:
apiKey(String, required): Your Appstack API key.isDebug(Bool, default: false): Leave as ‘false’ for production. See Development setup if you need to test against the development environment.logLevel(LogLevel, default: .info): Logging level for debugging.
Sending events
Important notes
- Always initialize the SDK before sending events
- Event names must match those defined in the Appstack platform
- Parameters are passed as a dictionary [String: Any] and can include any key-value pairs (e.g., revenue, currency, quantity)
- Revenue parameters support automatic type conversion (Double, Int, Float, String)
- Revenue ranges are configured in the Appstack platform and automatically synchronized
The
INSTALL event is tracked automatically on SDK initialization. Do not send it manually.revenueorprice(number).currency(string, e.g.EUR,USD).
email.name(first + last name in the same field).phone_number.date_of_birth(recommended format:YYYY-MM-DD).
Advanced configuration
SDK behavior
The SDK automatically:- Fetches configuration from Appstack servers.
- Manages conversion value updates based on event tracking.
- Handles revenue range matching for conversion optimization.
- Processes events in time-based windows (0-2 days, 3-7 days, 8-35 days).
- Queues events when the configuration is not ready.
Event processing
- Events are processed asynchronously to avoid blocking the main thread.
- The SDK queues events if the configuration is not yet loaded.
- Revenue parameters are automatically validated and converted to numeric values.
- Events are matched against configured revenue ranges in real-time.
Development setup
If you want to test the SDK against the Appstack development environment before shipping, follow these extra steps:- In Appstack, from the side menu, select SDK, switch to the Development environment, and copy the Development API key. This key is separate from your production key.
- In your
configure(...)call, use the development key and setisDebug: true:
isDebug flag must match the key you’re using: development key with isDebug: true, production key with isDebug: false. The flag tells the SDK which environment URL to route to.
Superwall
To start using the Superwall integration, click here to see the correct SDK documentation.Apple Ads
To start using the Apple Ads integration, click here to see the correct SDK documentation.Support
For questions or issues:- Check the GitHub Repository.
- Contact our support team at support@appstack.tech.
- Open an issue in the repository.
Use Cursor, Claude Code, or another AI to validate your existing Appstack Swift SDK integration.