Giter Site home page Giter Site logo

swanandmaratheblisstering / titanium-socketio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tidev/titanium-socketio

0.0 2.0 0.0 705 KB

Use the native Socket.io SDK's with Axway Titanium.

License: Apache License 2.0

Java 40.10% JavaScript 3.41% Objective-C 56.48%

titanium-socketio's Introduction

Socket.io client for Titanium

Socket.IO module for Titanium using native Android and iOS clients.

Getting started

Install the module to you project or globally by copying it into the modules folder. After that enable it in your tiapp.xml.

<modules>
    <module platform="android">ti.socketio</module>
    <module platform="ios">ti.socketio</module>
</module>

Usage

This module aims to be as compatible with the web client as possible. Please refer to the Client API for a full API documentation of all supported methods.

const io = require('ti.socketio');
const socket = io.connect('http://localhost:8080');
socket.on('connect', function() {
    Ti.API.debug('socket connected');

    socket.emit('hello', 'world');
});

Currently supported methods are:

  • io([url][, options]) (exposed as connect)
  • socket.open()
  • socket.connect()
  • socket.emit(eventName[, ...args][, ack])
  • socket.on(eventName, callback) (Note: Using acknowledgement callbacks not supported yet)
  • socket.off([eventName], [fn])
  • socket.close()
  • socket.disconnect()

You can pass the option keys from both JS and native when creating a new socket. But only options that are actually supported on the native side will be converted to the matching configuration option. For example the JS query option will be converted to the connectionParams option in the native iOS framework.

Useful links

Based on the socket.io-client-java on Android and socket.io-client.swift on iOS.

Contributions

Open source contributions are greatly appreciated! If you have a bugfix, improvement or new feature, please create an issue first and submit a pull request against master.

Getting Help

If you have questions about the Socket.IO module for Titanium, feel free to reach out on Stackoverflow or the #helpme channel on TiSlack. In case you find a bug, create a new issue or open a new JIRA ticket.

License

Apache License, Version 2.0

titanium-socketio's People

Contributors

janvennemann avatar hansemannn avatar

Watchers

James Cloos avatar Swanand avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.