I have a Realm class in React Native which defines my database. I want to use encryption but the key is retrieved from the Keystore.
RealmService.js
function getSecret() {
// retrieve key
// return value
return "example";
}
export default new Realm({path: 'db.realm', schema: [Auth, Wiretransfer], encryptionKey: getSecret()});
The problem is that I get 0 errors but when opening the Realm db in Realm Studio the file is not encrypted. So I assume it is because the encryptionKey value is null at creation.
How can I use the return value of a function in my export default?