nativescript-socket.io icon indicating copy to clipboard operation
nativescript-socket.io copied to clipboard

Cant connect to nodejs socket v4 with io.socket:socket.io-client v1

Open xeroxstar opened this issue 3 years ago • 3 comments

Hello, A small tip: This module wont work with nodejs socket.io server 4.0.0 by connecting with the client socket io.socket:socket.io-client: 1+, you should upgrade current socket client version to io.socket:socket.io-client:2+.

After changing the dependencies in include.gradle from:

dependencies {
    compile ('io.socket:socket.io-client:1.+') {
      exclude group: 'org.json', module: 'json'
    }
}

to:

dependencies {
    compile ('io.socket:socket.io-client:2.+') {
      exclude group: 'org.json', module: 'json'
    }
}

i could establish the connection to nodejs server. I hope it will help to community!

xeroxstar avatar Mar 28 '21 03:03 xeroxstar

I had the same issue, your solution worked 10/10.

AlejandroGuzmanCL avatar Apr 29 '21 17:04 AlejandroGuzmanCL

Hmm, no sadly doesn't work for me

ReazerDev avatar Aug 13 '21 23:08 ReazerDev

I've got it fixed now. I had to add the network_security_config.xml file to my project.

ReazerDev avatar Aug 14 '21 00:08 ReazerDev