MoEngageRecommendationsRequestFailureReason

@objc(MoEngageRecommendationsRequestFailureReason)
public final class MoEngageRecommendationsRequestFailureReason : MoEngageRequestFailureReason

Module-specific failure reason for MoEngageRecommendations failures emitted from the typed-task API surface.

Customers inspect moduleCode first for a Recommendations-specific signal; if nil, fall back to the base class’s code for shared cross-cutting handling (e.g. .sdkNotInitialized when this module’s own SDK-enabled check fails, or .featureDisabled when the module is blocked via remote config).

One case this subclass can never carry: .sdkNotInitialized raised by MoEngageAction itself when no instance is registered for the workspace id at all — that auto-rejection happens before this module’s code ever runs, so it always produces the shared MoEngageCoreRequestFailureReason, never this type.

  • Recommendations-specific failure codes.

    Mirrors RecommendationsFailureReason in the shared mobile SDK contract so the values line up across platforms.

    See more

    Declaration

    Swift

    @objc(MoEngageRecommendationsRequestFailureReasonModuleCode)
    public enum ModuleCode : Int
  • Non-nil for Recommendations-specific failures; nil when the reason used a shared base-class Code (e.g. .sdkNotInitialized) instead.

    Declaration

    Swift

    @objc
    public let moduleCode: NSNumber?
  • Create a Recommendations-specific module failure reason. The shared code is derived from the module code via sharedCode(for:) so customers that switch on the base-class Code see an honest classification (e.g. a blank recommendation id → .invalidParameters).

    Declaration

    Swift

    @objc
    public init(moduleCode: ModuleCode)

    Parameters

    moduleCode

    The Recommendations-specific module code.

  • Create a Recommendations reason for a shared cross-cutting code emitted from within the module — .sdkNotInitialized (SDK-enabled check), .featureDisabled (r_s blocked), .networkError/.parseError/ .unknownError (transport/decode failure), or .cancelled (superseded mid-fetch). Every module-owned rejection uses this or init(moduleCode:) — never the base class directly — so the subclass is always returned.

    Declaration

    Swift

    public override init(code sharedCode: MoEngageRequestFailureReason.Code)

    Parameters

    sharedCode

    A base-class Code value.