nowelium / socket.io-titanium

socket.io for titanium mobile
http://youtu.be/10ogNjWCpyc
Other
136 stars 34 forks source link

socket.io-titanium

socket.io@0.9.1-1(socket.io-client@0.9.1-1) TiMob SDK 1.8.1

How to use

Example

channel chat titanium example: Resources/win_ti.js channel chat server example: example-nodejs-server/chat.js

va io = require('socket.io-titanium');
var socket = io.connect('169.254.10.100:8080');
var chat = socket.of('/chat');
chat.on('available_channel', function (channels){
  channels.forEach(function (channelName){
    var row = Ti.UI.createTableViewRow({ title: channelName });
    ...
  });
  ...
});
chat.on('broadcat:message', function(message){
  ....
});

input.addEventListener('return', function(){
  chat.emit('post', input.value);
});

win.addEventListener('open', function(){
  chat.emit('join:channel', channelId);
});

Notes