MoEngageSDKStateHelper

@objc
public class MoEngageSDKStateHelper : NSObject

Helper for querying the runtime state of the MoEngage SDK.

Use MoEngageSDKStateHelper to check whether the SDK has been initialised for a given workspace and whether it is currently enabled or disabled. Both checks resolve the matching SDK instance and report their result asynchronously through a completion handler delivered on the main thread.

Pass the workspace appID to target a specific instance, or omit it to query the default instance.

  • Returns the current state of the SDK, i.e. whether it is enabled or disabled.

    Declaration

    Swift

    @objc
    public static func isSDKEnabled(
        appID: String? = nil,
        completion: @escaping @MainActor(unsafe) (Bool) -> Void
    )

    Parameters

    appID

    MoEngage Account Identifier

    completion

    Returns true if SDK is enabled else false, delivered on the main thread.

  • Checks if the SDK is initialised with given account identifier

    Declaration

    Swift

    @objc
    public static func isSDKInitialized(
        appID: String? = nil,
        completion: @escaping @MainActor(unsafe) (Bool) -> Void
    )

    Parameters

    appID

    MoEngage Account Identifier

    completion

    Returns true if SDK is initialized else false, delivered on the main thread.

  • Checks if the SDK is initialised with default account

    Declaration

    Swift

    @objc
    public static func isSDKInitialized(_ completion: @escaping @MainActor (Bool) -> Void)

    Parameters

    completion

    Returns true if SDK is initialized else false, delivered on the main thread.