nodeKey
: String - the name of the API Node. (What is an API Node?)nodeValue
: Object - the settings to store the node.[nodeValue.entity]
: Object - data to pass to the launched application. Obtainable in the launched application's
connected client in the launchParams
property.Applications have the possibility to launch other applications in the IWC. Rather than just opening a link in a new tab, the System API can be used to pass important information to the launching application much like how Android allows passing serialized data to new activities.
To launch an application, simply call the launch
action on the corresponding resource.
var systemApi = client.system();
systemApi.launch("/application/com.ozp.bouncingBalls");
To launch an application with data passed to it:
var data = {
"Hello": "world!"
};
systemApi.launch("/application/com.ozp.bouncingBalls",{entity: data});
The launched application can gather the launch data using the getLaunchData
method. It uses promises to resolve after
the client has connected:
var launchData = {};
client.getLaunchData().then(function(data){
launchData= data;
});
Alternatively, launch data can be passed to the opening application in the following places so long as the key
is
ozpIwc.launchData
:
(?launchData=<stringified & URI-encoded object>)
(#launchData=<stringified & URIencoded object>)
To stringify and URI-encode a value in javascript:
var obj = {'a': 1};
var stringified = JSON.stringify(obj);
var uriEncoded = encodeURIcomponent(stringified);