daltoniam / Starscream

Websockets in swift for iOS and OSX
Apache License 2.0
8.3k stars 1.2k forks source link

WatchOS connection #872

Open Fublvckmagik opened 3 years ago

Fublvckmagik commented 3 years ago

Hi, I have a client application that uses the starscream framework. Everything works very well. Now I need to write an application on WathcOS where communication with the server will also be established.

How can I connect to the server via WatchOS? Should I use Starscream library and connect directly or do it via Iphone? Thanks

msonnino commented 3 years ago

I haven't tried using sockets from the Watch directly and I'm too novice to tell you if it's possible or recommended, but here are my 2 cents: I have an iOS app with a Watch companion. My app is designed so that the main functionality is on the Watch and the iPhone app is just for setup and such. Anyways I use sockets a lot and it's all routed through the iPhone. I can say that it works very well, no connectivity or latency issues.

m260154117 commented 6 months ago

In order to realize that the Apple watch can send and receive messages like wechat in the case of offline mobile phones, the iOS side and the server side are currently using mqtt protocol, can the native socket of Apple watch be used normally?