Intempt
  1. SDK
Intempt
  • Installation
    • Basic Intempt Installation
    • Create source
    • Web Snippet
    • Google Tag Manager
    • Autocapture setup
    • SPA tracking
    • Environment Setup
    • Validating Installation
  • SDK
    • JS SDK
    • Android SDK
    • iOS SDK
    • Node.js SDK
  • API Reference
    • Track data
      POST
    • Consent
      POST
    • Choose API
      POST
    • Recommendations Feed API
      POST
  • Data Ingestion & Tracking
    • identify()
    • track()
    • record()
    • alias()
    • group()
    • consent()
    • intempt:html / intempt:page / intempt:session
    • Product Catalog Ingestion via API
  • Data Models & Event Schema
    • Event Schema Overview
    • Required Fields
    • Attribute Schema
    • Product Catalog Schema
  • Webhooks
    • Webhook Configuration
  • Server Side Experiments
    • Overview
    • Choose API endpoint
    • Handling Experiment Response
  1. SDK

iOS SDK

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#

EventDefinition
TouchRecorded when a user taps or touches a UI control, such as buttons, sliders, or any interactive elements.
View ScreenCaptured every time a user views a screen within the app. Useful for tracking navigation and screen engagement.
Leave ScreenLogged when a user exits a screen. Helps understand user flows and potential interface issues.
ActionTriggered by an interaction like submitting a form or clicking a link. Useful for identifying effective CTAs.
App Install/UpgradeTracks app installations or upgrades with version and build details.
Start SessionLogs the start of a new user session.
End SessionRecorded 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#

iOS 13.0+
Xcode 11.0 or later

Installation#

Create a Source#

1.
Go to Integrations → Sources.
2.
Click Create Source.
3.
Choose the iOS option.
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.
1.
Open your .xcodeproj.
2.
Navigate to File → Add Packages…
3.
Paste the URL:

[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.
5.
Set Embed & Sign:
Go to Target → Build Phases
Expand Embed Frameworks
Add Intempt.xcframework
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#

Works with Xcode 11.3+

SceneDelegate.swift#

ViewController.swift#


Initialization — Objective-C#

AppDelegate.m (Xcode 11.3+)#

ViewController.m#


Authorize SDK#

Copy the following from the Intempt console:
Source ID
Project ID
Organization ID
API Key
Use them in your initialization parameters.

Supported Event Types#

Auto-Tracked Events#

Touch
View Screen
Leave Screen
Action
App Install/Upgrade
Start Session
End Session

Custom 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#

ParameterTypePurpose
queueEnabledBOOLEnables batching events. Default: YES
itemsInQueueIntNumber of events needed before a batch is sent. Default: 5
timeBufferTimeIntervalInterval in seconds to send events periodically. Default: 5
isInputTextCaptureDisabledBOOLPrevents capturing text inputs. Default: NO
initialDelayTimeIntervalDelay 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#

Check:
timeBuffer
itemsInQueue

Field Type Validation#

Ensure event fields match the schema types.
Example:
String expected:
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
Previous
Android SDK
Next
Node.js SDK
Built with