Skip to content
This repository has been archived by the owner on Aug 16, 2019. It is now read-only.

Latest commit

 

History

History
39 lines (29 loc) · 748 Bytes

README.md

File metadata and controls

39 lines (29 loc) · 748 Bytes

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.