crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
55 stars 17 forks source link

A websocket error occured #90

Closed rezafaraji93 closed 2 years ago

rezafaraji93 commented 2 years ago

I have implemented Socket IO v2 in my android app connect to server without any issues. But CrispSocket shows an error:

E/CrispSocket: A websocket error occured. Name: connect_error Args: [ io.socket.client.SocketIOException: It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, which is not possible ]

and : E/CrispSocket: (Initialization Error) Error starting chat

I am using this version of Socket IO:

implementation ('io.socket:socket.io-client:2.0.1') { exclude group: 'org.json', module: 'json' }

Doc1faux commented 2 years ago

Hi @rezafaraji93 and thank you for your feedback. As mentioned in your logs, Crisp servers are using Socket.IO v2.x. So you have to stick with the Socket.IO-client Java v1.x as mentioned in their Compatibility section. Just replace your import with this one:

implementation ('io.socket:socket.io-client:1.0.1') {
  exclude group: 'org.json', module: 'json'
}