Other Protocols

The following protocols are available globally.

  • Protocol for all Analytics related Events

    See more

    Declaration

    Swift

    @MainActor
    @preconcurrency
    @objc
    public protocol MoEngageAnalyticsCallBack : Sendable

MoEngageSDKEventObserver

  • Observer for SDK-autonomous events (e.g. background batch sync results). Register via MoEngage.registerSDKEventObserver(_:forWorkspaceId:) after SDK init for the workspace; pre-init registrations are dropped with a warning. Each registration is workspace-scoped; accountMeta on the callback identifies the originating workspace. Multiple observers fire in registration order; the same observer registered twice fires twice. onSDKEvent is invoked on the main thread.

    See more

    Declaration

    Swift

    @objc(MoEngageSDKEventObserver)
    public protocol MoEngageSDKEventObserver
  • Swift-only typed surface for MoEngageBaseTask subclasses. Each subclass binds concrete Success and Failure types; the protocol extension provides typed onSuccess / onFailure and an async throws result(). ObjC consumers use the Any-typed methods on the base class.

    See more

    Declaration

    Swift

    public protocol MoEngageTaskProtocol : AnyObject

Date Provider Abstraction

  • Date provider abstraction for testability

    Provides a consistent interface for obtaining the current date/time, allowing for deterministic time-based testing through mock implementations.

    See more

    Declaration

    Swift

    public protocol MoEngageDateProvider

Delegate Protocol

MoEngageShownCampaign

  • Shared shape for any shown-campaign success result (MoEngageShowInAppResult and MoEngageShowNudgeResult). Lets customers write cross-cutting code (logging, analytics passthrough) that handles “campaign shown” events regardless of category.

    See more

    Declaration

    Swift

    @objc
    public protocol MoEngageShownCampaign
  • Declaration

    Swift

    @objc
    public protocol MoEngageInAppModeling
  • Declaration

    Swift

    @objc
    public protocol MoEngageTestInAppProtocol
  • Protocol that both MoEngageActivityAttributes and MoEngageTransactionActivityAttributes conform to

    See more

    Declaration

    Swift

    @available(iOS 18, *)
    public protocol MoEngageActivityAttributesProtocol : ActivityAttributes where Self.ContentState : MoEngageContentStateProtocol
  • Protocol for campaign data that both regular and transaction campaigns conform to

    See more

    Declaration

    Swift

    @available(iOS 18, *)
    public protocol MoEngageCampaignProtocol : Decodable, Encodable, Hashable
  • Protocol for instance data that both regular and transaction instances conform to

    See more

    Declaration

    Swift

    @available(iOS 18, *)
    public protocol MoEngageInstanceProtocol : Decodable, Encodable, Hashable
  • Protocol for content state that both regular and transaction content states conform to

    See more

    Declaration

    Swift

    @available(iOS 18, *)
    public protocol MoEngageContentStateProtocol : Decodable, Encodable, Hashable
  • Protocol defining common properties for campaign result types

    See more

    Declaration

    Swift

    @available(iOS 18, *)
    public protocol CampaignResultProtocol
  • Protocol defining common properties for campaign models

    See more

    Declaration

    Swift

    @available(iOS 18, *)
    public protocol CampaignProtocol