ApplePersistenceConfig

data class ApplePersistenceConfig(val serviceName: String, val keychainAccessibility: KeychainAccessibility?, val accessGroup: String? = null)

Apple-platform configuration for Kalium's encrypted key/value storage.

Consumers (host apps) construct this and hand it to CoreLogic. It is then carried through to every Apple-side site that talks to the iOS Keychain.

Constructors

Link copied to clipboard
constructor(serviceName: String, keychainAccessibility: KeychainAccessibility?, accessGroup: String? = null)

Properties

Link copied to clipboard
val accessGroup: String?

Runtime Keychain access-group name shared by the host app and its extensions. For an App Group this is the literal group.* identifier. For a group added through Keychain Sharing this includes the prefix that Xcode applies while signing. Both targets must include this exact value in their signed entitlements. Keep null to use the target's default access group.

Link copied to clipboard

When Kalium-managed entries can be read, as the iOS Keychain kSecAttrAccessible value. Null keeps Apple's default, KeychainAccessibility.WhenUnlocked, under which Kalium can't read its tokens and database keys while the device is locked, e.g. when the app is launched in the background by a push. Apps that run Kalium in the background should use KeychainAccessibility.AfterFirstUnlockThisDeviceOnly. Must be stable across app versions, like serviceName: it is part of every Keychain lookup, so entries stored with a different value are neither found nor overwritten (storing one again fails), and they are not migrated. Applies on iOS only; the file-based macOS keychain ignores it.

Link copied to clipboard
val serviceName: String

Stable identifier used as the iOS Keychain kSecAttrService value for all Kalium-managed entries (auth tokens, passphrases, per-user config). Must be stable across app reinstalls, typically the host app's bundle identifier. Must NOT be derived from NSHomeDirectory(), which embeds the iOS Application UUID and changes on every reinstall, orphaning every previously stored entry.