Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Swift Realm Encryption and Sync with server

Tags:

ios

swift

realm

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?

like image 490
Jeyachandran Avatar asked Oct 30 '22 07:10

Jeyachandran


1 Answers

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)
like image 116
bdash Avatar answered Nov 15 '22 07:11

bdash