CleanInsightsSDK Documentation Beta

Class Default​Store

open class DefaultStore: Store

Default implementation of a store. Stores the data in plist format in a given folder. If no folder is given, defaults to the app's Application Support directory on MacOS or its Documents directory elsewhere.

The #send implementation just uses Cocoa's URLRequest.

DefaultStore DefaultStore Store Store DefaultStore->Store

Superclass

Store

The store holds the user's consents to the different Features and Campaigns, and their Visit and Event measurements.

Initializers

init(_:​_:​)

public override init(_ args: [String : Any] = [:], _ debug: ((_ message: String) -> Void)? = nil)

Parameters

args [String :​ Any]

The location where to read and persist accumulated data. Either in the key "storageFile", which is expected to contain the fully qualified URL to a file. Or a "storageDir" URL, which is expected to point to a directory. OPTIONAL. Defaults to the app's Application Support directory on MacOS or its Documents directory elsewhere.

debug ((_ message:​ String) -> Void)?

Optional function to output debug messages.

init(from:​)

required public init(from decoder: Decoder) throws

Methods

load(_:​)

public override func load(_ args: [String : Any]) -> Store?

persist(_:​_:​)

public override func persist(_ async: Bool, _ done: @escaping (Error?) -> Void)

send(_:​_:​_:​_:​)

public override func send(_ data: Data, _ server: URL, _ timeout: TimeInterval, _ done: @escaping (Error?) -> Void)