For the complete documentation index, see llms.txt. This page is also available as Markdown.

iOS SDK

Show Zigpoll surveys inside your iOS app. The SDK presents surveys in a native bottom sheet — you decide exactly when a survey appears by triggering it from code.

Prefer to start from working code? Clone the ready-to-run example app. SDK source: zigpoll-ios.

Requirements

  • iOS 15 or later

  • Swift 5.7 or later

Installation

Swift Package Manager

In Xcode, go to File → Add Package Dependencies and enter:

https://github.com/zigpoll/zigpoll-ios

CocoaPods

Add to your Podfile and run pod install:

pod 'Zigpoll'

Set up your survey

  1. In the Zigpoll dashboard, create a survey.

  2. Set the survey's delivery type to API (Delivery Settings → API). This tells Zigpoll the survey only appears when your app requests it.

  3. Copy the survey ID from the survey's install section.

Leave the survey's response setting on the default (once per participant). URL-dependent response settings are a web concept and are not supported on mobile.

Configure the SDK

Call configure once, early in your app's lifecycle (e.g. in your App init or AppDelegate):

Your account ID is shown in the dashboard under Installation.

Identified users keep their survey state across sessions and devices — a completed survey stays completed if you trigger it again. Without identify, an anonymous device-persistent ID is used instead.

Call Zigpoll.logout() when the user signs out.

Trigger a survey

The survey slides up in a native bottom sheet. The from: parameter is optional — by default the top-most view controller presents the sheet, which works well in SwiftUI apps:

Responses are recorded slide by slide, so partial responses are captured even if the user dismisses the sheet mid-survey.

Metadata

Attach metadata to responses for segmentation, targeting, and personalization:

The SDK automatically includes source=mobile-sdk, platform=ios, the SDK version, and your app version, so you can filter mobile responses in the dashboard.

Callbacks

onComplete fires once when the respondent finishes the survey. onClose fires whenever the sheet is dismissed, with any responses collected so far.

Development builds

With preview: true, surveys open and behave normally but responses are not billed or counted in your analytics. Use this in debug/QA builds.

Notes

  • Call all SDK methods on the main thread.

  • The SDK has zero third-party dependencies and only presents UI when you trigger a survey — there is no background activity.

Last updated