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.
Swift - 2
Enable surveys in your configuration
RequiredTo enable surveys in your iOS app, enable surveys in your PostHog configuration:
Swift
Supported Features
| Feature | Support |
|---|---|
| Questions | |
| All question types | ✅ |
| Multi-question surveys | ✅ |
| Confirmation message | ✅ |
| Feedback button presentation | ❌ |
| Conditional questions | ✅ |
| Customization / Appearance | |
| Set colors in PostHog dashboard | ✅ |
| Shuffle questions | ❌ |
| PostHog branding | ❌ |
| Delay popup after screen view | ❌ |
| Position config | ❌ (always bottom sheet) |
| HTML content | ❌ |
| Display conditions | |
| Feature flag & property targeting | ✅ |
| Screen targeting | ❌ |
| Device type targeting | ✅ |
| Survey wait period | ❌ |
| Event triggers | ✅ |
| Action triggers | ❌ |
| Partial responses | ❌ |
Limitations
- Surveys are only available on iOS
- Surveys require iOS 15.0 or later