Skip to content

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

@adboio

Description

@adboio

Summary

The Android 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 function in PostHogSurveysIntegration.kt only checks for event-based repeated activation:

private fun canActivateRepeatedly(survey: Survey): Boolean {
    return survey.conditions?.events?.repeatedActivation == true && hasEvents(survey)
}

Expected Behavior

Should also check for schedule == "always":

private fun canActivateRepeatedly(survey: Survey): Boolean {
    return (survey.conditions?.events?.repeatedActivation == true && hasEvents(survey)) ||
           survey.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