Core Concepts
WhiskrKit is a feedback layer for your mobile app, not a one-off survey tool. Understanding a few key concepts will help you get the most out of it.
Surveys
Section titled “Surveys”A survey is created and configured in the WhiskrKit dashboard. Each survey has:
- A unique identifier you reference in your app
- A type: a rating scale (NPS, CSAT, CES or your own scale), star rating, thumbs up/down, textual, or multiple choice
- A presentation style, sheet, toast, or full-screen
- Eligibility rules, who sees it, when, and how often
Your app code only needs the identifier. Everything else is controlled from the dashboard, meaning you can change survey behaviour without shipping an app update.
Eligibility
Section titled “Eligibility”When you attach .whiskrKitSurvey(identifier:) to a view, WhiskrKit checks eligibility before presenting anything. Eligibility rules are configured per survey in the dashboard and can include:
- Session count, only show after the user has opened the app a certain number of times
- Cooldown, wait a minimum period before showing again
- Repeat policy, show once, on a cooldown, or always
If a user does not meet the eligibility criteria, nothing is shown. No code changes required on your side.
Presenting Surveys
Section titled “Presenting Surveys”WhiskrKit supports two presentation modes.
Automatic presentation
Section titled “Automatic presentation”Attach .whiskrKitSurvey(identifier:) to a view. WhiskrKit checks eligibility when the view appears and presents the survey if the user qualifies.
HomeView() .whiskrKitSurvey(identifier: "nps-survey")Place this on a view that represents a meaningful moment in the user journey, after a completed trip, after a purchase, or on your main tab view.
Event-driven presentation
Section titled “Event-driven presentation”For cases where timing is yours but targeting should still be respected, for example after a sheet dismisses, use checkAndPresent(surveyId:):
.onDismiss { WhiskrKit.shared.checkAndPresent(surveyId: "settings-feedback")}Unlike present(surveyId:), eligibility rules are respected. Unlike .whiskrKitSurvey(identifier:), the moment it fires is yours to control.
Manual presentation
Section titled “Manual presentation”For cases where you control the trigger, a feedback button, a push notification, or a custom event, use the imperative API instead.
Step 1: Register an attachment point once, high in your hierarchy:
@mainstruct MyApp: App { var body: some Scene { WindowGroup { ContentView() .whiskrKit() } }}Step 2: Call present(surveyId:) from anywhere:
Button("Give Feedback") { WhiskrKit.shared.present(surveyId: "nps-survey")}Manual presentation bypasses eligibility checks. The survey is fetched and shown immediately.
Theming
Section titled “Theming”WhiskrKit is fully customisable. You can match the look of your app by providing a WhiskrKitTheme:
WhiskrKit.shared.setTheme(.systemStyle)A built-in systemStyle preset is available if you want a sensible default that respects iOS conventions. For full control, construct a WhiskrKitTheme with your own container styles, button styles, and text styles.
Theme components include container styles (sheet, toast, full-screen), button styles (primary, secondary), and text styles (title, subtitle, headline, subheadline, body). WhiskrKit supports Dynamic Type and dark mode natively, supply adaptive colours for best results.
A toast’s own title and description use the headline and subheadline styles, the same as the question title below them. From 0.3.0 you can style them separately with the toast’s title and description text styles (ContainerTheme.banner on Android). Leave them unset to keep the default look.
The colours of a selected rating score are fixed rather than themeable; see Rating metrics.
Call setTheme after initialize in your app entry point.
Rating metrics
Section titled “Rating metrics”Every rating question measures something: NPS (0 to 10), CSAT (1 to 5), CES (1 to 7), or a custom scale. You pick the metric when you create the question in the dashboard, and the dashboard calculates it from the scores. Your app only shows the scale and sends the number the user chose.
From SDK 0.3.0, the scale follows the metric:
- Colours. The selected score is coloured by what it means: for NPS, 0 to 6 red, 7 and 8 gold, 9 and 10 green; for CSAT, 4 and 5 green. Other scores, CES and custom scales use a neutral blue. These colours are fixed rather than themeable, so they always meet WCAG contrast in light and dark mode. A selected score also gets an outline, so the selection never depends on colour alone.
- End labels. A line under the scale explains its ends. NPS, CSAT and CES use WhiskrKit’s own labels (“Not at all likely” to “Extremely likely”, “Very dissatisfied” to “Very satisfied”, “Very difficult” to “Very easy”), translated into the ten built-in languages. A custom scale shows the labels you enter in the dashboard, or none. Screen readers read the labels with each score.
- Stars. A scale from 1 to 5 can be shown as five stars instead of numbers.
- Large text. The score buttons grow with the user’s text size and wrap onto more rows when they don’t fit.
Older SDK versions ignore the metric and show the numbered scale as before, with the selected score coloured from red to green by its position. Answers are recorded the same way from every version, so results from old and new app versions add up. Rating questions created before rating metrics existed are custom questions, so apps on 0.3.0 show them in the neutral blue without end labels.
Response tracking
Section titled “Response tracking”When a user completes a survey, WhiskrKit records the completion locally and submits the response to the dashboard. Completion data is used to enforce repeat policies, so a user who already responded to an NPS survey won’t be shown it again until the cooldown expires.
This is why WhiskrKit becomes more useful over time: the longer it runs in your app, the more accurate your eligibility targeting becomes, and the richer your response data grows.