/nativescript-socketio

Socket.IO for nativescript

Primary LanguageTypeScriptMIT LicenseMIT

npm npm

nativescript-socketio

Usage

npm install nativescript-socketio

or

tns plugin add nativescript-socketio

Set connection string and options then connect

var SocketIO = require('nativescript-socketio').SocketIO; 
var socketIO = new SocketIO(url, opts);

Alternatively:

import { SocketIO } from 'nativescript-socketio';
var socketIO = new SocketIO(url, opts);

Connect to server

socketIO.connect()

Send data to the server

socketIO.emit(event,data)

Listen for data

socketIO.on(event,callback)

Set instance

new SocketIO(null,null,oldInstance)

##Running Demo

Start socketio server

cd demo/demo-server
npm install
node app

start demo

cd demo
tns run android

##Screenshot socketio