Access synced Realm from extension?


I added a SiriKit extension to my app, such that users are able to add items to my lists using Siri. Everything works well with the local Realm.

But when the app is logged in to the cloud, SyncUser.current keeps returning nil in the SiriKit extension. For the app it’s not nil. I can restart it and it’s set. Because of the user being nil in SiriKit, it will access the local Realm instead of the synced Realm.

How do I solve this? SiriKit should access the same state the user is seeing in the app.


@ischuetz Synced Realms are not multi-process and you cannot access the same synced Realm via file access - if you want to do this you would need to login in both the extension and the app and proxy through ROS.


Ok, so I’d have to store the credentials in the keychain. This login will rarely have to happen, right? Probably only the first time?