CLASS
ClientConfig
public class ClientConfig
Configuration class for the Omniconvert SDK client
Properties
defaultReinitTimeout
public static let defaultReinitTimeout: TimeInterval = 600
defaultSessionTimeout
public static let defaultSessionTimeout: TimeInterval = 1800
defaultLoadingTolerance
public static let defaultLoadingTolerance: TimeInterval = 2.2
Methods
init(storage:customConfig:)
public init(storage: StorageFacadeProtocol, customConfig: [String: Any] = [:])
Initialize client configuration - Parameters: - storage: Storage facade for persistence - customConfig: Optional custom configuration values
Parameters
| Name | Description |
|---|---|
| storage | Storage facade for persistence |
| customConfig | Optional custom configuration values |
get(_:)
public func get(_ key: String) -> Any?
Get a configuration value - Parameter key: The configuration key - Returns: The configuration value, or nil if not found
Parameters
| Name | Description |
|---|---|
| key | The configuration key |
get(_:as:)
public func get<T>(_ key: String, as type: T.Type) -> T?
Get a configuration value as a specific type - Parameters: - key: The configuration key - type: The expected type - Returns: The configuration value cast to the specified type, or nil
Parameters
| Name | Description |
|---|---|
| key | The configuration key |
| type | The expected type |
get(_:defaultValue:)
public func get<T>(_ key: String, defaultValue: T) -> T
Get a configuration value with a default fallback - Parameters: - key: The configuration key - defaultValue: The default value to return if key is not found - Returns: The configuration value or the default value
Parameters
| Name | Description |
|---|---|
| key | The configuration key |
| defaultValue | The default value to return if key is not found |
set(_:value:)
public func set(_ key: String, value: Any)
Set a configuration value - Parameters: - key: The configuration key - value: The value to set
Parameters
| Name | Description |
|---|---|
| key | The configuration key |
| value | The value to set |
getAll()
public func getAll() -> [String: Any]
Get all configuration values - Returns: Dictionary of all configuration values
rebuildSettings()
public func rebuildSettings()
Rebuild settings from storage
getReinitTimeout()
public func getReinitTimeout() -> TimeInterval
Get reinit timeout in seconds - Returns: Reinit timeout value
getSessionTimeout()
public func getSessionTimeout() -> TimeInterval
Get session timeout in seconds - Returns: Session timeout value
getLoadingTolerance()
public func getLoadingTolerance() -> TimeInterval
Get loading tolerance in seconds - Returns: Loading tolerance value
isLocationCollectionEnabled()
public func isLocationCollectionEnabled() -> Bool
Check if location collection is enabled - Returns: True if location collection is enabled
getAllowedOrigins()
public func getAllowedOrigins() -> String
Get allowed origins - Returns: Allowed origins string
setReinitTimeout(_:)
public func setReinitTimeout(_ timeout: TimeInterval)
Set reinit timeout - Parameter timeout: Timeout in seconds
Parameters
| Name | Description |
|---|---|
| timeout | Timeout in seconds |
setSessionTimeout(_:)
public func setSessionTimeout(_ timeout: TimeInterval)
Set session timeout - Parameter timeout: Timeout in seconds
Parameters
| Name | Description |
|---|---|
| timeout | Timeout in seconds |
setLoadingTolerance(_:)
public func setLoadingTolerance(_ tolerance: TimeInterval)
Set loading tolerance - Parameter tolerance: Tolerance in seconds
Parameters
| Name | Description |
|---|---|
| tolerance | Tolerance in seconds |
setLocationCollection(_:)
public func setLocationCollection(_ enabled: Bool)
Enable or disable location collection - Parameter enabled: Whether to enable location collection
Parameters
| Name | Description |
|---|---|
| enabled | Whether to enable location collection |
setAllowedOrigins(_:)
public func setAllowedOrigins(_ origins: String)
Set allowed origins - Parameter origins: Allowed origins string
Parameters
| Name | Description |
|---|---|
| origins | Allowed origins string |