Skip to content

Commit b4a2fd9

Browse files
authored
Merge pull request #1233 from appwrite/fix-swift-websocket-onopen-callback
2 parents b9405cc + 85fb57a commit b4a2fd9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

templates/swift/Sources/WebSockets/WebSocketClient.swift.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,13 @@ public class WebSocketClient {
297297
self.channel = channel
298298
}
299299

300-
return channel.pipeline.addHandler(handler)
300+
return channel.pipeline.addHandler(handler).map {
301+
if let delegate = self.delegate {
302+
delegate.onOpen(channel: channel)
303+
} else {
304+
self.onOpen(channel)
305+
}
306+
}
301307
}
302308

303309
// MARK: - Close connection

0 commit comments

Comments
 (0)