0.4.0 • Published 8 years ago

cordova-plugin-oic v0.4.0

Weekly downloads
5
License
Apache 2.0
Repository
github
Last release
8 years ago

cordova-plugin-oic

A Cordova plugin to expose the OIC specification to cross platform applications written in JavaScript.

Purpose

To provide a plugin which allows using the OIC specification across all mobile platforms without requiring the user to deal with implementing and compiling the native code for each operating system.

Current platforms:

  • Android

Building

As this is a Cordova plugin, you will build it as part of an app. For a demo app, please see the cordova-plugin-oic-demo app. Build instructions are located at its README file.

Running tests

This plugin contains a test suite that runs as a Cordova app. Pleae find it at the cordova-plugin-oic-tests project page.

Quick start with the API

var plugin = cordova.require('cordova/plugin/oic');

plugin.onresourcefound = function(event) {
    var resource = event.resource;
    // Do something with the resource.
};

plugin.onupdate = function(event) {
    var updates = event.updates;
    // Update your UI when changes have occurred.
};

plugin.setBackend('iotivity').then(function() {
    plugin.findResources();
});

More details can be found at the OIC JS spec for the Soletta project.