UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Best sync option for watchOS / SwiftUI?

Forums > watchOS

I have an app where ideally I have sync between web, mobile, and watchos.

Firestore (firebase) works well for sync between web and mobile. But I'm a bit stuck as to the best option for watchOS. WatchOS doesn't support firestore, but even if it does, I think many apple watches don't have internet support so I want an option based on watchconnectivity.

I use watchconnectivity to send the data, but just store it in @State. When I kill the watchOS app, the state goes away, even though I'd rather it persist.

What is the best option to persist it ? Is it CoreData, AppStore, or some other option? CoreData seems like the most reliable option, but also a lot of extra code to keep the watchOS coreData synced with the firestore app. Wanted to post here in case anyone has any insights.

I have some apps on my watch that seem to sync with their iOS companion apps without much problems, even if I turn off the iphone and kill the watchOS app, when I restart the watchOS app, the basic state persists. So these devs are doing something - is it just coredata? appstorage? or something else. Wanted to post here in case any good ideas.

4      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.