Anyone built a watch app on Realm?

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?

1 Like

No responses… I guess this means no? :slightly_frowning_face:

The only info I can find regarding this is a few years old and there was no way to do it then, has anyone got any recent info on this?

Btw, is there a way to access the legacy Realm forum? It held info which would still be useful now.

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 :confused:

@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.

1 Like

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.

I think it might work. WatchOS doesn’t support websockets, but it seems like appollo-ios works on the apple watch: https://github.com/apollographql/apollo-ios/issues/153.

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!

Are there any plans for supporting sync on watchOS?

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:
https://developer.apple.com/documentation/foundation/urlsession/3181171-websockettask

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

One issue that was discussed some years ago was that the size limit for swift apps for watchOS made it impossible to add the Realm frameworks(https://github.com/realm/realm-cocoa/issues/5203), although at the time the limit was 50 mb, and I think last year it was 85 mb so maybe this is no longer an issue.

But using Realm without sync is not an option.

I’m in the same situation as you where every comparable app in the same category has a watchOS version so I would hope that it’s on the roadmap.

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.

1 Like

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.

2 Likes

Just submitted a feature request :wink:

1 Like

If anyone wants to upvote & watch the feature request @Simon_Persson raised, it is: Support Apple Watch (Sync).

Regards,
Stennie