We have a simple swift app, that listens to a simple UserData table. If we make changes in the Realm App everything syncs fine. The code that listens to the changes looks like this
let results = RealmManager.shared.userRealm.objects(UserData.self)
self.notificationToken = results.observe { (changes: RealmCollectionChange) in
switch changes {
case .initial:
NSLog("initial")
if results.count > 0 {
self.name = results[0].name
}
case .update(let results, _, _, _):
NSLog("update")
if results.count > 0 {
self.name = results[0].name
}
case .error(let error):
// An error occurred while opening the Realm file on the background worker thread
fatalError("\(error)")
}
}
If we edit the data in Compass, we do not get an update
call back. However, if we log out, reopen the Realm, re-set up the listener, everything works fine. Is this a known issue and are there any work arounds?
Thanks