UserDefaultsPreferencesStorage

class UserDefaultsPreferencesStorage

Default implementation to store SDK preferences.

Uses the UserDefaults.standard of the app.

The values are not encrypted.

  • Constructs the preferences storage

    Declaration

    Swift

    init()
  • A preference should be stored in the storage

    Declaration

    Swift

    func put(key: String, value: String?)

    Parameters

    key

    The key of the preference

    value

    The value for the given key

  • A preference should be read from the storage

    Declaration

    Swift

    func get(key: String) -> String?

    Parameters

    key

    The key of the preference

    Return Value

    The value for the given key. Can be nil if there is no value stored for this key.