I used this configuration code for Realm Encryption
let configuration = Realm.Configuration(encryptionKey: "key" as Data)
let realm = try! Realm(configuration: configuration)
I used this configuration code for Realm Sync with server
let configuration = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user, realmURL: syncServerURL))
let realm = try! Realm(configuration: configuration)
How we can do both Encryption and Sync with server using Realm?
The Realm.Configuration
initializer can accept multiple arguments if you'd like to specify multiple aspects of the configuration:
let config = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user, realmURL: syncServerURL),
encryptionKey: theKey)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With