iOS surveys installation
Contents
- 1
Add PostHog to your app
RequiredUsing it requires PostHog's iOS SDK version >= 3.31.0, but it's recommended to always use the latest version.
PostHog is available through CocoaPods or you can add it as a Swift Package Manager based dependency.
CocoaPods
PodfileSwift Package Manager
Add PostHog as a dependency in your Xcode project "Package Dependencies" and select the project target for your app, as appropriate.
For a Swift Package Manager based project, add PostHog as a dependency in your
Package.swiftfile's Package dependencies section:Package.swiftand then as a dependency for the Package target utilizing PostHog:
Package.swiftConfiguration
Configuration is done through the
PostHogConfigobject. Here's a basic configuration example to get you started.You can find more advanced configuration options in the configuration page.
SwiftSwift - 2
Enable surveys in your configuration
RequiredTo enable surveys in your iOS app, enable surveys in your PostHog configuration:
Swift
Supported Features
Not all survey features are available on every SDK. See the SDK feature support matrix for a full comparison.
Limitations
- Surveys are only available on iOS
- Surveys require iOS 15.0 or later