Intempt iOS SDK API Documentation#
Overview#
The iOS SDK enables you to track user interactions within your iOS app and manage its configuration via the Intempt console.The initialized iOS SDK automatically collects the following events with data-rich attributes:Auto-Tracked Events#
| Event | Definition |
|---|
| Touch | Recorded when a user taps or touches a UI control, such as buttons, sliders, or any interactive elements. |
| View Screen | Captured every time a user views a screen within the app. Useful for tracking navigation and screen engagement. |
| Leave Screen | Logged when a user exits a screen. Helps understand user flows and potential interface issues. |
| Action | Triggered by an interaction like submitting a form or clicking a link. Useful for identifying effective CTAs. |
| App Install/Upgrade | Tracks app installations or upgrades with version and build details. |
| Start Session | Logs the start of a new user session. |
| End Session | Recorded after 5 minutes of inactivity, useful for session length analysis. |
Following this guide, you can also track custom events and perform personalization campaigns and A/B experiments.
Requirements#
Installation#
Create a Source#
1.
Go to Integrations → Sources.
4.
Copy the snippet provided — you'll need it for SDK initialization.
Create the API Key#
Refer to the API Keys section to generate a unique API key for authenticating the SDK.
Initialize the SDK#
Integration using Swift Package Manager#
Intempt fully supports Swift Package Manager.2.
Navigate to File → Add Packages…
[https://github.com/intempt/intempt-intemptios](https://github.com/intempt/intempt-intemptios)
4.
Choose the master branch.
Integration as a Manual Framework#
1.
Download the SDK repository as a ZIP file.
2.
Locate Intempt.xcframework.
3.
Copy it into your project directory.
4.
Drag & drop Intempt.xcframework into your iOS app in Xcode.
Go to Target → Build Phases
Go to Target → General → Frameworks, Libraries, and Embedded Content
Ensure Embed & Sign is selected.
After these steps, the project should compile without errors.
Initialization — Swift#
SceneDelegate.swift#
ViewController.swift#
Initialization — Objective-C#
AppDelegate.m (Xcode 11.3+)#
ViewController.m#
Authorize SDK#
Copy the following from the Intempt console:Use them in your initialization parameters.
Supported Event Types#
Auto-Tracked Events#
Touch
View Screen
Leave Screen
Action
App Install/Upgrade
Start Session
End SessionCustom Events#
Custom events are actions you define inside your code.Once tracked, custom events appear automatically in the Events list of the Intempt console.
SDK Methods#
IntemptConfig Parameters#
| Parameter | Type | Purpose |
|---|
| queueEnabled | BOOL | Enables batching events. Default: YES |
| itemsInQueue | Int | Number of events needed before a batch is sent. Default: 5 |
| timeBuffer | TimeInterval | Interval in seconds to send events periodically. Default: 5 |
| isInputTextCaptureDisabled | BOOL | Prevents capturing text inputs. Default: NO |
| initialDelay | TimeInterval | Delay before sending events. Default: 0.2 |
Track#
Record#
identify()#
Identify with attributes#
group()#
Group with attributes#
Consent#
Accept#
Reject#
Category Consent#
Alias#
Product Events#
productView#
productAdd#
productOrdered#
Utility Methods#
isUserOptIn#
logout#
getProfileId#
getSessionId#
disableTextInput#
optOut#
optIn#
enableLogging#
disableLogging#
validateTrackingSession#
endTrackingSession#
startTrackingSession#
Experiments & Personalization#
chooseExperiments (byNames)#
chooseExperiments (byGroups)#
choosePersonalizations (byNames)#
choosePersonalizations (byGroups)#
Recommendation API#
Troubleshooting#
Framework built for unsupported architectures#
Set:
Target → Build Settings → Validate Workspace = NO
Toggle YES → NO if needed.App Store architecture errors#
Add a Run Script Phase and include the provided lipo-cleaning script.dyld: Library not loaded#
Ensure:
Intempt.xcframework = Embed & Sign"Intempt no such module"#
Delete the framework, clean DerivedData, re-add Intempt.xcframework.No data visible#
iOS SDK batches events periodically — allow a few seconds.Events taking too long to send#
Field Type Validation#
Ensure event fields match the schema types.Accepted:
const event = { name: "John Doe" }Rejected:
const event = { name: { first: "John", last: "Doe" } }Adding new fields is supported — existing fields must remain same type.Modified at 2025-12-03 09:47:29