Protect

@ProtectActor
public class Protect

The Protect class provides methods to initialize the SDK and retrieve device signal data

  • Configures the Protect SDK with the provided configuration. This method should be called before calling initialize().

    Declaration

    Swift

    @ProtectActor
    public static func config(_ block: (ProtectConfig) -> Void)

    Parameters

    block

    A closure that configures the ProtectConfig.

  • initialize() Asynchronous

    Initializes the Protect SDK with the provided configuration. This method should be called before using any other methods in the Protect SDK.

    Throws

    ProtectError if initialization fails.

    Declaration

    Swift

    public nonisolated static func initialize() async throws
  • data() Asynchronous

    Retrieves the signal data from the Protect SDK. This method should be called after initialize() to get the data.

    Throws

    ProtectError if data retrieval fails.

    Declaration

    Swift

    public nonisolated static func data() async throws -> String

    Return Value

    A string containing the behavioral data.

  • Pause behavioral data collection

    Throws

    ProtectError if SDK is not initialized

    Declaration

    Swift

    public nonisolated static func pauseBehavioralData() throws
  • Resume behavioral data collection

    Throws

    ProtectError if SDK is not initialized

    Declaration

    Swift

    public nonisolated static func resumeBehavioralData() throws