Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Ionic 5 Websocket Server not working

$
0
0

I’ve run into multiple issues trying to get the documented example for Websocket Server to work. The issue I’m finally stumped on is that this line:

this.wsserver.watchMessage().subscribe(result => {
                      console.log(result);
                    });

gives this error

TypeError: window.cordova.plugins.wsserver[fnName] is not a function

I’ve tried uninstalling and reinstalling the npm packages but don’t know what else to do to try and resolve this.

For reference, previous issue was that the documented example line

import { WebSocketServer } from '@ionic-native/web-socket-server';

causes the constructor to fail because WebSocketServer is a value, and instead should be

import { WebSocketServer } from '@ionic-native/web-socket-server/ngx';

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>