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
See moreRecommendationsFailureReasonin the shared mobile SDK contract so the values line up across platforms.Declaration
Swift
@objc(MoEngageRecommendationsRequestFailureReasonModuleCode) public enum ModuleCode : Int -
Non-
nilfor Recommendations-specific failures;nilwhen the reason used a shared base-classCode(e.g..sdkNotInitialized) instead.Declaration
Swift
@objc public let moduleCode: NSNumber? -
Create a Recommendations-specific module failure reason. The shared
codeis derived from the module code viasharedCode(for:)so customers thatswitchon the base-classCodesee an honest classification (e.g. a blank recommendation id →.invalidParameters).Declaration
Swift
@objc public init(moduleCode: ModuleCode)Parameters
moduleCodeThe 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_sblocked),.networkError/.parseError/.unknownError(transport/decode failure), or.cancelled(superseded mid-fetch). Every module-owned rejection uses this orinit(moduleCode:)— never the base class directly — so the subclass is always returned.Declaration
Swift
public override init(code sharedCode: MoEngageRequestFailureReason.Code)Parameters
sharedCodeA base-class
Codevalue.