JavaScript code injection WebSocket server to Titanium app.
Python Java Objective-C JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
android
assets
documentation
example
iphone
test_app
test_server
.gitignore
.gitmodules
LICENSE
README
README.md

README.md

for ti-stats-hook and YaTriple

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!