For iOS and macOS brownfield applications, you can access the shared storage layer from Swift or Objective-C using the StorageRegistry singleton. This allows native code to read from and write to the same storage used by the React Native layer.
Access the storage by calling StorageRegistry.shared.getStorage(dbName: "name"). Use setValues and getValues with Entry objects to manage data. Note that these operations are typically asynchronous and should be handled within a Task or similar concurrency construct.
import AsyncStorage
import SharedAsyncStorage
// access shared storage via StorageRegistry
let storage: SharedStorage = StorageRegistry.shared.getStorage(dbName: "my-users")
Task {
storage.setValues([Entry(key: "email", value: "john@example.com")])
let values = storage.getValues(keys: ["email"])
print("Stored email: \(values.first?.value ?? "none")")
}