{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/4363","repository_url":"https://api.github.com/repos/realm/realm-cocoa","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4363/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4363/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4363/events","html_url":"https://github.com/realm/realm-cocoa/issues/4363","id":191427920,"number":4363,"title":"MacOS Synced Realm","user":{"login":"natemann","id":5096440,"avatar_url":"https://avatars.githubusercontent.com/u/5096440?v=3","gravatar_id":"","url":"https://api.github.com/users/natemann","html_url":"https://github.com/natemann","followers_url":"https://api.github.com/users/natemann/followers","following_url":"https://api.github.com/users/natemann/following{/other_user}","gists_url":"https://api.github.com/users/natemann/gists{/gist_id}","starred_url":"https://api.github.com/users/natemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natemann/subscriptions","organizations_url":"https://api.github.com/users/natemann/orgs","repos_url":"https://api.github.com/users/natemann/repos","events_url":"https://api.github.com/users/natemann/events{/privacy}","received_events_url":"https://api.github.com/users/natemann/received_events","type":"User","site_admin":false},"labels":[{"id":154724428,"url":"https://api.github.com/repos/realm/realm-cocoa/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed","default":false},{"id":3303146,"url":"https://api.github.com/repos/realm/realm-cocoa/labels/T:Help","name":"T:Help","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-24T03:49:31Z","updated_at":"2016-11-26T01:41:48Z","closed_at":null,"body":"in Realm 2.04, I had the following code to initialize a synced realm\r\n\r\n```\r\n    if let user = SyncUser.all().first {\r\n        Realm.setDefaultConfiguration(withUser: user)\r\n    }\r\n\r\n    public static func setDefaultConfiguration(withUser user: SyncUser) {\r\n        Realm.Configuration.defaultConfiguration = Realm.Configuration(syncConfiguration: (user, Server.realmURL), readOnly: false, schemaVersion: 15, migrationBlock: migrationBlock, deleteRealmIfMigrationNeeded: true)\r\n    }\r\n```\r\n\r\nin 2.1.0, I changed the code to:\r\n\r\n```\r\n    if let user = SyncUser.all.first?.value {\r\n            Realm.setDefaultConfiguration(withUser: user)\r\n    }\r\n\r\n    public static func setDefaultConfiguration(withUser user: SyncUser) {\r\n        Realm.Configuration.defaultConfiguration = Realm.Configuration(syncConfiguration: SyncConfiguration(user: user, realmURL: Server.realmURL), readOnly: false, schemaVersion: 15, migrationBlock: migrationBlock, deleteRealmIfMigrationNeeded: true)\r\n    }\r\n```\r\n\r\nEverything works fine in the iOS app with the above new code, but the macOS app constantly returns an empty Realm file. I have checked the realm configuration, and it appears to be pointing to the correct URL and is set up properly."},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/263037954","html_url":"https://github.com/realm/realm-cocoa/issues/4363#issuecomment-263037954","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4363","id":263037954,"user":{"login":"natemann","id":5096440,"avatar_url":"https://avatars.githubusercontent.com/u/5096440?v=3","gravatar_id":"","url":"https://api.github.com/users/natemann","html_url":"https://github.com/natemann","followers_url":"https://api.github.com/users/natemann/followers","following_url":"https://api.github.com/users/natemann/following{/other_user}","gists_url":"https://api.github.com/users/natemann/gists{/gist_id}","starred_url":"https://api.github.com/users/natemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natemann/subscriptions","organizations_url":"https://api.github.com/users/natemann/orgs","repos_url":"https://api.github.com/users/natemann/repos","events_url":"https://api.github.com/users/natemann/events{/privacy}","received_events_url":"https://api.github.com/users/natemann/received_events","type":"User","site_admin":false},"created_at":"2016-11-26T01:41:48Z","updated_at":"2016-11-26T01:41:48Z","body":"@stel, I found my issue, I was fetching realm objects before the synced Realm was configured. Is there a way to get a notification after the realm is fully configured?"}}
{"actor":{"display_login":"natemann"}}