Amplitude's Guides and Surveys iOS SDK enables you to deploy Guides and Surveys in your iOS applications.
The Guides and Surveys iOS SDK requires:
Install the Guides and Surveys iOS SDK with Swift Package Manager or CocoaPods.
https://github.com/amplitude/Amplitude-Engagement-Swift
Amplitude-Engagement-Swift
package, version 1.0.5
.pod install
.
pod 'AmplitudeEngagementSwift', '~> 1.0.5'
import AmplitudeEngagementSwift // Initialize the SDKlet amplitudeEngagement = AmplitudeEngagement("YOUR_API_KEY") // (optional) Add the plugin to your Amplitude instance// (needed for event-based triggers to work)let configuration = Configuration( apiKey: API_KEY)let amplitude = Amplitude(configuration: configuration)amplitude.add(plugin: amplitudeEngagement.getPlugin())
Parameter | Type | Description |
---|---|---|
apiKey |
string |
Required. API key of the Amplitude project you want to use. |
initOptions.serverZone |
EU or US |
Optional. Sets the Amplitude server zone. Set this to EU for Amplitude projects created in EU data center. Default: US |
initOptions.logLevel |
LogLevel.None or LogLevel.Error or LogLevel.Warn or LogLevel.Verbose or LogLevel.Debug . |
Optional. Sets the log level. Default: LogLevel.Warn |
initOptions.locale |
string |
Optional. Sets the locale for localization. Default: undefined . Not setting a language means the default language is used. |
// Basic boot with user IDamplitudeEngagement.boot("USER_ID") // Advanced boot with optionslet bootOptions = AmplitudeBootOptions( user_id: "USER_ID", device_id: "DEVICE_ID", user_properties: ["key": "value"])amplitudeEngagement.boot(options: bootOptions)
// Track screen views to trigger guides based on screensamplitudeEngagement.screen("HomeScreen")
Pin and tooltip guides require the ability for the SDK to target specific elements on screen. To enable this in your app:
// Swift UI MySwiftView { }.amplitudeView("MySwiftView") let myView = MyUIKitView(...)myView.accessibilityIdentifier = "MyView"
Configure the visual theme mode if your app supports light and dark modes.
// Set the theme modeamplitudeEngagement.setThemeMode(ThemeMode.DARK) // Options: LIGHT, DARK, SYSTEM
Reset a guide or survey to a specific step.
amplitudeEngagement.reset(key = "GUIDE_KEY", stepIndex = 0)
Parameter | Type | Description |
---|---|---|
key |
string |
Required. The guide or survey's key. |
stepIndex |
number |
Required. The zero-based index of the step to reset to. Defaults to the initial step. |
Retrieve a list of all live guides and surveys along with their status.
val guidesAndSurveys = amplitudeEngagement.list()
Display a specific guide or survey. Ignores any targeting rules and limits except for page targeting.
amplitudeEngagement.show(key = "GUIDE_KEY")
Parameter | Type | Description |
---|---|---|
key |
string |
Required. The guide or survey's key. |
If you don't use the plugin, but want to trigger Guides using events.
amplitudeEngagement.forwardEvent([ "event_type": "my event type", "event_properties": [String: String]()])
Close all active guides and surveys.
amplitudeEngagement.closeAll()
To use preview mode to test a guide or survey in your app, configure a custom URL scheme in your.
In Amplitude, navigate to your Project's settings.
On the General tab, locate the URL scheme (mobile) field. Copy its value, for example, amp-abc123
.
AmplitudeURLScheme
.amp-abc123
.// In your AppDelegate or SceneDelegatefunc application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { if amplitudeEngagement.handleUrl(url) { return true } // Handle other URL schemes return false}
June 23rd, 2025
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2025 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.