diff --git a/android/src/main/java/software/eskimo/capacitor/sockets/SocketHandler.java b/android/src/main/java/software/eskimo/capacitor/sockets/SocketHandler.java index b9c113d..9ec4344 100644 --- a/android/src/main/java/software/eskimo/capacitor/sockets/SocketHandler.java +++ b/android/src/main/java/software/eskimo/capacitor/sockets/SocketHandler.java @@ -32,6 +32,8 @@ public class SocketHandler { public void connect(final String host, final int port, final boolean useTLS, final boolean acceptInvalidCertificates) { new Thread(() -> { try { + delegate.onStateChanged(id, "connecting"); + if (useTLS) { SSLContext sslContext = SSLContext.getInstance("TLS"); if (acceptInvalidCertificates) {