Was just wondering if anyone have built a watch app with Realm and if so, how you handle transferring data between the watch app and iOS app? Is there a good way to do this using Realm?
I know that the realm cloud sync doesn’t work since it requires a web socket connection. So I guess I need to transfer the data to the iOS app using the watch connectivity framework. Anyone found a good way to do this?
I haven’t seen any info either. The articles on the Realm site are from 2015.
I found a couple of issues on github:
From what I can see, sync doesn’t work as it relies on websockets. But my understanding is that it should be possible to build apps without sync. I hope improving watch support is something that is on the roadmap. Many of my competitors have watch apps already
@Simon_Persson Sync does not work on watchOS but local Realms do - you can use a bluetooth library or similar to transfer data to the local mobile app which could be used with Sync.
Thanks @Ian_Ward ! Yes, I assume that this is the way to go, but it does rule out standalone apps on the watch. Hmm shouldn’t it be possible to post data to atlas using the new graphql apis and achieve sync that way instead?
Yeah that should be possible but I think the watch has a non-standard networking stack so I’m not sure if all networking libraries will integrate, this is part of the reason we don’t have realm sync out of the box on watchOS.
If I change the datamodel so that the data to sync is only a single document then I think it might work. You won’t get real-time sync this way, but I think it might work for some use-cases. Worth a try!
I know one reason that has been stated before is that WatchOS didn’t support websockets, but that doesn’t seem to be the case anymore:
Personally I’d love to see sync for WatchOS. A lot of my competitors already have watch support, but judging by AppStore reviews they all struggle with sync. If MongoDB Realm would solve this it would be a game changer
The addition of URLSessionWebSocketTask on watchOS 6.2 seems to provide the needed WebSocket functionality in terms of transport. Not sure if there are any auth limitations.
@Ian_Ward Is there any plan to move to URLSessionWebSocketTask and a flow that will sync from the watch?
We’ve paused production on our watch counterpart until we can sync. Thanks.
Thanks - I saw that. There are still other considerations so if sync from watchOS is something you are interested in please make a feature request here https://feedback.mongodb.com/ and we can consider it as part of roadmap planning.