Skip to content

Support survey schedule 'always' (show every time) #446

@adboio

Description

@adboio

Summary

The iOS SDK does not support the schedule: 'always' survey setting, which should allow surveys to be shown every time regardless of whether they've been seen before.

Current State

The canActivateRepeatedly computed property in PostHog/Surveys/PostHogSurveyIntegration.swift only checks for event-based repeated activation:

var canActivateRepeatedly: Bool {
    conditions?.events?.repeatedActivation == true && hasEvents
}

Expected Behavior

Should also check for schedule == "always":

var canActivateRepeatedly: Bool {
    (conditions?.events?.repeatedActivation == true && hasEvents) ||
    schedule == "always"
}

Reference Implementation

See posthog-js browser: packages/browser/src/extensions/surveys/surveys-extension-utils.tsx lines 584-591

For mobile-specific patterns, see posthog-react-native: packages/react-native/src/surveys/getActiveMatchingSurveys.ts

Tracking

This is tracked in the survey SDK feature parity issue: PostHog/posthog#45658

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions