MoEngageInAppRequestFailureReason

@objc(MoEngageInAppRequestFailureReason)
public final class MoEngageInAppRequestFailureReason : MoEngageRequestFailureReason

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

Customers inspect moduleCode first for an InApp-specific signal; if nil, fall back to the base class’s code for shared cross-cutting handling (e.g. .sdkNotInitialized when no instance is registered for the given appId).

  • InApp-specific failure codes.

    See more

    Declaration

    Swift

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

    Declaration

    Swift

    @objc
    public let moduleCode: NSNumber?
  • Identifier of the campaign that failed, when a specific campaign was identifiable at failure time. Non-nil for .renderFailed and .htmlAssetLoadFailed (a campaign was selected before the render-side failure, so the SDK has its id in hand). nil for .campaignNotFound (no specific campaign exists) and for any shared-code failure (e.g. .sdkNotInitialized) emitted before campaign selection runs.

    NSSecureCoding caveat: not preserved across encode/decode round-trips — see the Reason-subclass encoding limitation MARK in MoEngageRequestFailure.swift. Customers needing post-decode access to campaignId should hold the original failure reference.

    Declaration

    Swift

    @objc
    public let campaignId: String?
  • Create an InApp-specific module failure reason for a non-campaign- specific failure (e.g. .campaignNotFound).

    Declaration

    Swift

    @objc
    public init(moduleCode: ModuleCode)

    Parameters

    moduleCode

    The InApp-specific module code.

  • Create an InApp-specific module failure reason carrying campaign identity — for .renderFailed / .htmlAssetLoadFailed where the SDK knows which campaign was selected before the failure.

    Declaration

    Swift

    @objc
    public init(moduleCode: ModuleCode, campaignId: String?)

    Parameters

    moduleCode

    The InApp-specific module code.

    campaignId

    Identifier of the campaign whose render/load failed.

  • Create an InApp reason for a shared cross-cutting code emitted from within InApps (e.g. .sdkNotInitialized when the instance lookup fails).

    Declaration

    Swift

    public override init(code sharedCode: MoEngageRequestFailureReason.Code)

    Parameters

    sharedCode

    A base-class Code value.

  • Declaration

    Swift

    public override var description: String { get }