🐛 Made watchOS URLSession wait for connectivty

This commit is contained in:
2025-11-01 12:19:56 +08:00
parent 01cc71fd47
commit b60bd63d0c

View File

@@ -44,7 +44,13 @@ struct WebSocketPacket {
// MARK: - Network Service
class NetworkService {
private let session = URLSession.shared
private let session: URLSession
init() {
let config = URLSessionConfiguration.ephemeral
config.waitsForConnectivity = true
session = URLSession(configuration: config)
}
// Add a serial queue for WebSocket operations
private let webSocketQueue = DispatchQueue(label: "com.solian.websocketQueue")