Skip to content

k0sukey/TiWSEvaluateJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Do not use for product.

Usage

  1. Boot WebSocket server
  2. Boot Titanium app
  3. Send Titanium JavaScript code from WebSocket server

Server

node.js WebSocket server example. See test_server.

var WebSocketServer = require('ws').Server,
	wss = new WebSocketServer({
		port: 8888
	});

wss.on('connection', function(ws){
	ws.send('var win = Ti.UI.createWindow({backgroundColor:"#000"}); win.open(); setTimeout(function(){win.backgroundColor = "#f00";}, 1000)');
});

App

See test_app.

  1. Install the this module
  2. Writing <property name="evaluate-host" type="string">ws://localhost:8888</property> in tiapp.xml
  3. Build!