NodeJS + SocketIO clicking on a mobile application

I see on the SocketIO website the ability to use SocketIO for a mobile device. I tried to find documentation on my site on how to do this, but I could not find.

Has anyone understood how to send a message to a mobile device using SocketIO? I assume it should live inside a WebView or something that can run javascript?

EDIT What if I do not plan to use Sencha or PhoneGap. I want to go to the harvest. Objective-C / Java. Is it possible?

Adding to the selected answer I found the java socket.io client https://github.com/benkay/java-socket.io.client

+5
source share
1

Socket.io, - ( , HTTP) . , - .

, , , , HTML, CSS JS. , , socket.io.

Node JS: Socket.io -

var io = require('socket.io').listen(80); // beauty is web socket still runs in 80/443(WSS) and leverages TCP capabilities.

io.sockets.on('connection', function (socket) {
  socket.emit('news', { hello: 'world' });
  socket.on('my other event', function (data) {
    console.log(data);
  });
});

JS HTML, -.

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io.connect('http://localhost');
  socket.on('news', function (data) {
    console.log(data);
    socket.emit('my other event', { my: 'data' });
  });
</script>

JS - socket.io.

, .

+5

All Articles