Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Chat message not showing properly in websocket connection

$
0
0

Hi Friends,

I am developing and android chat application using alloy framework, I would like to make a websocket connection with our server to get chat messages. Our web app already using websocket connection for the same and which is done using socket.io. I would like to use TIWS module (net.iamyellow.tiws) to do this. I used the following code in the alloy

var websocket = require('net.iamyellow.tiws').createWS();
 
 websocket.addEventListener('open', function() {
    // Ti.API.info('websocket opened');
     alert(1);
 });
 
 websocket.addEventListener('message', function(ev) {
    // // ev.data contains message data
     alert(ev);
 });
 
websocket.open('ws://xxxxxx8000/socket.io/1/websocket/249443487316');

this doesn't alert any real chat message, but this creates a continues alert message like below

bubbles=false, data=2::, source=net.iamyellow.tiws.WSProxy@451814b0, type=message, cancelBubble=false

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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