nodeValue
: 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 reference.
var bouncingBallsRef = new iwc.system.Reference("/application/com.ozp.bouncingBalls");
bouncingBallsRef.launch();
To launch an application with data passed to it:
var data = {
"Hello": "world!"
};
bouncingBallsRef.launch(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 = {};
iwc.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);