You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am working on a React Native app and I have setup socketcluster websocket and I was able to connect to it from the app because I exposed the port of the websocket running locally on my PC with ngrok, but when I tried to listen to message events from the socket I keep getting TypeError: Object is not async iterable error in the command line and the app could not get any message from the socket
this is the code for listening to message event according to the documentation
try{forawait(letdataofthis.socket_channel){console.log('listenForData::: I got data from socket:::',data);}}catch(error){console.log('socket message conn err',error);}
the socket initialization
this.websocket_instance=newSocketCluster.create({hostname: 'x.tcp.xx.ngrok.io',port: xxxxx})this.socket_channel=this.websocket_instance.subscribe(channel_name)awaitthis.socket_channel.listener('subscribe').once()this.socket_channel.transmitPublish('hello from mobile phone')
the websocket connects successfully but I can't subscribe to message event and I can't get message from the socket
please is there any other ways I can subscribe to message event from the websocket except from using the for await (let data of this.socket_channel) { way, please help
The text was updated successfully, but these errors were encountered:
paulosabayomi
changed the title
I got TypeError: Object is not async iterable error while trying to listen to message event
I got TypeError: Object is not async iterable error while trying to listen to message event in React Native app
Jun 21, 2023
Hi I am working on a React Native app and I have setup socketcluster websocket and I was able to connect to it from the app because I exposed the port of the websocket running locally on my PC with ngrok, but when I tried to listen to message events from the socket I keep getting
TypeError: Object is not async iterable
error in the command line and the app could not get any message from the socketthis is the code for listening to message event according to the documentation
the socket initialization
the websocket connects successfully but I can't subscribe to message event and I can't get message from the socket
please is there any other ways I can subscribe to message event from the websocket except from using the
for await (let data of this.socket_channel) {
way, please helpThe text was updated successfully, but these errors were encountered: