Closed remusmp closed 7 years ago
There is an alternative method onBinaryMessage
which is called when receiving a binary message instead of a text message. Is it possible that this is the case here?
@MinnDevelopment Just tried that out too:
@Override
public void onBinaryMessage(WebSocket websocket, byte[] binary) throws Exception {
Log.d(mApp.DEBUG_TAG, "Binary message");
}
It doesn't get triggered :( It's weird because I can send data from the Android app to the server through the web socket (one way communication).
It works! I was sending from the server in a wrong way (django-channels). I fixed that and everything works now as expected! Many thanks!
Thank you very much for this package. I think I'm overlooking something really simple to get things working. I'm able to connect to my server as onConnected callback is triggered. I'm also able to send messages to my server as I can see them arriving on the server side. However when I send a message from my server the onTextMessage callback is not triggered :(
I'm extracting some lines of code showing how I've set things up in my Android app:
extensions are null, which I find weird because I've set the per message deflate extension. onConnected is called, no problems here (I can also see the connection on the server side). Sending messages to the server also works. The issue is that onTextMessage is never called when I send messages from the server :(
Have I missed some configuration of the websocket?