Open manhhungptit opened 4 years ago
Hi there,
Did you resolve it? I am also having the same problem. If you have found any solution, please let me know.
Thanks.
The ionic wrapper is broken, at least with the current version of the plugin. The only way I could use in angular is drop the watch* subscribe functions and instead use the javascript like API via wsServer.
let wsOpts = {
'onOpen': (conn) => {
// your code
},
'onMessage': (conn, msg) => {
// your code
}, ...
};
this.wsServer.open(<WebSocketOptions> wsOpts);
Hi, I'm using your plugin in a Ionic app build with Angular and Capacitor build.
In the app, I create a WebSocket Server instance, then using watchMessage().subscribe to listen to any message that come. Here is my service class
The connection is established and connected well with a websocket client, but after I sent a message "Hello" from websocket client, the subscribe callback function was not called, even though the log on the device show this:
Thank you.