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
- Check if campaign has FC bypass flags (ignore_global_fc > ignore_fc_count > normal)
- Evaluate global FC limits for the trigger type
- Evaluate campaign-level FC limits
- Evaluate tag-based FC limits (if applicable)
- 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
stateManagerThe FC state manager for counter operations
sessionFCStoreThe session FC store for session-scoped counters
fcSettingsGlobal 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) -> MoEngageInAppFCEvaluationResultParameters
campaignThe campaign to evaluate
triggerTypeThe trigger type for evaluation
isPriorityStageWhether this is Priority stage (true) or Impression stage (false)
Return Value
FC evaluation result with canShow flag and blocking reason