/plugin-socket.io

socket.io plugin for PhoneGap/Cordova

Primary LanguageJavaApache License 2.0Apache-2.0

plugin-socket.io

socket.io plugin for PhoneGap/Cordova. Currently Android only.

cordova plugin add https://github.com/wf9a5m75/plugin-socket.io

This plugin uses these libraries:

###Usage

var socket = plugin.socket.io.connect("http://yourhost.com:12345");
socket.on("connect", function() {
  alert("connected");
  
  socket.emit("hi", "My name is Hogehoge", function(res) {
    alert(JSON.stringify(res));
  });
});

socket.one("welcome", function(msg){
  alert(msg);
});

socket.on("error", function(err) {
  alert(err);
});

###Note This plugin works with Socket.io >= 1.0

Sending binary is not available.