MoEngageInAppFCEvaluator

public final class MoEngageInAppFCEvaluator

Core Frequency Capping evaluator that determines whether campaigns can be shown

This class implements the main FC evaluation logic, checking various FC rules including global settings, campaign-level overrides, and tag-based rules.

Key Features

  • Global FC Evaluation: Checks global FC limits for all trigger types
  • Campaign-Level Override: Handles campaign-specific FC settings
  • Tag-Based Evaluation: Supports both all-tags (AND) and any-tag (OR) conditions
  • Bypass Logic: Handles ignore_global_fc and ignore_fc_count flags
  • Pure Function: No side effects, logging handled by controller integration

FC Evaluation Flow

  1. Check if campaign has FC bypass flags (ignore_global_fc > ignore_fc_count > normal)
  2. Evaluate global FC limits for the trigger type
  3. Evaluate campaign-level FC limits
  4. Evaluate tag-based FC limits (if applicable)
  5. Return evaluation result with blocking reason

Bypass Precedence

  • ignore_global_fc: Skip all global and tag checks, return success
  • ignore_fc_count: Continue evaluation but skip increment
  • normal: Full FC evaluation with all rules
  • Initializes the FC evaluator with required dependencies

    Declaration

    Swift

    public init(stateManager: MoEngageInAppFCStateManager, sessionFCStore: MoEngageInAppSessionFCStore?, fcSettings: MoEngageInAppFCSettings? = nil)

    Parameters

    stateManager

    The FC state manager for counter operations

    sessionFCStore

    The session FC store for session-scoped counters

    fcSettings

    Global FC settings (optional, defaults to nil for no FC limits)

  • Evaluates FC rules for a campaign and trigger type

    This method performs comprehensive FC evaluation including:

    • Global FC limit checking
    • Campaign-level FC override checking
    • Tag-based FC evaluation
    • Bypass logic handling

    Declaration

    Swift

    public func evaluateFC(for campaign: MoEngageInAppCampaignMeta,
                           triggerType: MoEngageInAppFCTriggerType,
                           isPriorityStage: Bool) -> MoEngageInAppFCEvaluationResult

    Parameters

    campaign

    The campaign to evaluate

    triggerType

    The trigger type for evaluation

    isPriorityStage

    Whether this is Priority stage (true) or Impression stage (false)

    Return Value

    FC evaluation result with canShow flag and blocking reason