TwilioVerifyBuilder

public class TwilioVerifyBuilder

Builder class that builds an instance of TwilioVerifyManager, which handles all the operations regarding Factors and Challenges

  • Creates a new instance of TwilioVerifyBuilder

    Declaration

    Swift

    public init()
  • Set the NetworkProvider that will be used by the TwilioVerify instance.

    Declaration

    Swift

    public func setNetworkProvider(_ networkProvider: NetworkProvider) -> Self

    Parameters

    networkProvider

    instance of a NetworkProvider

  • Defines if the storage will be cleared after a reinstall

    Declaration

    Swift

    public func setClearStorageOnReinstall(_ clearStorageOnReinstall: Bool) -> Self

    Parameters

    clearStorageOnReinstall

    If true, the storage will be cleared after a reinstall, so created factors will not exist in the device anymore. If false, created factors will persist in the device. Default value is true

  • Set the accessGroup that will be used for the Keychain storage.

    Declaration

    Swift

    public func setAccessGroup(_ accessGroup: String?) -> Self

    Parameters

    accessGroup

    Used to specify the access group for the kSecAttrAccessGroup of the KeyChain. if nil the data will be only available in the app, otherwise using a KeyChain group will enable the option to access data from service extensions.

  • Enables the default logger

    Declaration

    Swift

    public func enableDefaultLoggingService(withLevel level: LogLevel) -> Self

    Parameters

    level

    Desired level of logging

  • Adds a custom Logging Service

    Declaration

    Swift

    public func addLoggingService(_ service: LoggerService) -> Self

    Parameters

    service

    Custom logging service to be used to log information

  • Set the Keychain query mode that will be used when accessing stored factors and keys.

    Default value is .legacy for backward compatibility with existing integrations.

    Declaration

    Swift

    public func setQueryMode(_ queryMode: KeychainQueryMode) -> Self

    Parameters

    queryMode

    The query mode to use when accessing the Keychain.

    • .strict: Recommended for new integrations. Filters Keychain items by the specific Service name (TwilioVerify). This isolates the SDK data and prevents collisions with keychain items from other libraries.
    • .legacy: Recommended for users upgrading from versions prior to 2.0 of Twilio Verify. Queries the Keychain without a Service filter for backward compatibility. Warning: May cause collisions if other keychain items exist with similar attributes.

  • Buids an instance of TwilioVerifyManager

    Throws

    TwilioVerifyError.initializationError if an error occurred while initializing.

    Declaration

    Swift

    public func build() throws -> TwilioVerify

    Return Value

    An instance of TwilioVerify.