Skip to content

Commit e91ef58

Browse files
loks0nabnegate
andauthored
Update templates/swift/Sources/Services/Realtime.swift.twig
Co-authored-by: Jake Barnby <[email protected]>
1 parent 2f47ceb commit e91ef58

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

templates/swift/Sources/Services/Realtime.swift.twig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ open class Realtime : Service {
2929
do {
3030
while !Task.isCancelled {
3131
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-
}
32+
client.send(text: #"{"type": "ping"}"#)
3733
}
3834
try await Task.sleep(nanoseconds: HEARTBEAT_INTERVAL)
3935
}

0 commit comments

Comments
 (0)