We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f47ceb commit e91ef58Copy full SHA for e91ef58
templates/swift/Sources/Services/Realtime.swift.twig
@@ -29,11 +29,7 @@ open class Realtime : Service {
29
do {
30
while !Task.isCancelled {
31
if let client = socketClient, client.isConnected {
32
- let pingMessage = ["type": "ping"]
33
- let jsonData = try JSONSerialization.data(withJSONObject: pingMessage)
34
- if let jsonString = String(data: jsonData, encoding: .utf8) {
35
- client.send(text: jsonString)
36
- }
+ client.send(text: #"{"type": "ping"}"#)
37
}
38
try await Task.sleep(nanoseconds: HEARTBEAT_INTERVAL)
39
0 commit comments