CLASS
# Configuration.Builder
@objc(ConfigurationBuilder) public class Builder: NSObject
Builds Configuration objects.
# Methods
# init(projectId:deviceName:)
@objc public init(
projectId: String,
deviceName: String? = nil
)
Initializing Configuration.Builder object.
- Parameters:
- projectId:
Project ID
setting for the MIRACL Platform. - deviceName: identifier that can help find the device on the MIRACL Trust Portal.
If not provided, the value of
deviceName
is the name of the operation system (e.giOS
).
- projectId:
# userStorage(userStorage:)
@discardableResult public func userStorage(
userStorage: UserStorage
) -> Builder
Set custom UserStorage implementation. / Parameter userStorage: custom UserStorage) implementation.
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
userStorage | custom ) implementation. |
# deviceName(deviceName:)
@objc(deviceNameWith:) @discardableResult public func deviceName(
deviceName: String
) -> Builder
Sets value of device name.
- Parameter deviceName: device name
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
deviceName | device name |
# logger(logger:)
@objc(loggerWith:) @discardableResult public func logger(
logger: Logger
) -> Builder
Set custom Logger writer implementation. / Parameter logger: custom Logger implementation.
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
logger | custom implementation. |
# loggingLevel(level:)
@objc(loggingLevelWith:) @discardableResult public func loggingLevel(
level: LoggingLevel
) -> Builder
Sets custom LoggingLevel value. By default it is none
.
This level can be set only for default logger, otherwise will be ignored.
/ Parameter level: custom LoggingLevel
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
level | custom |
# platformURL(url:)
@objc(platformURLWith:) @discardableResult public func platformURL(
url: URL
) -> Builder
Sets custom MIRACL platform URL.
- Parameter url: custom MIRACL platform URL.
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
url | custom MIRACL platform URL. |
# applicationInfo(applicationInfo:)
@objc(applicationInfoWith:) @discardableResult public func applicationInfo(
applicationInfo: String
) -> Builder
Sets additional application information that will be sent via X-MIRACL-CLIENT HTTP header.
- Parameter applicationInfo: application info.
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
applicationInfo | application info. |
# URLSessionConfiguration(urlSessionConfiguration:)
@objc(URLSessionConfigurationWith:) @discardableResult public func URLSessionConfiguration(
urlSessionConfiguration: URLSessionConfiguration
) -> Builder
Use this when you want to set the custom configuration to the SDK’s instance of URLSession.
As a default value it uses ephemeral
configuration, 30 seconds for timeoutIntervalForRequest
and
300 seconds for timeoutIntervalForResource
.
- Parameter urlSessionConfiguration: configuration for the URLSession to be set.
- Returns: Configuration.Builder object.
# Parameters
Name | Description |
---|---|
urlSessionConfiguration | configuration for the URLSession to be set. |
# build()
@objc public func build() throws -> Configuration
Returns Configuration object. / Throws: ConfigurationError. / Returns: Configuration object.