INDEX

void connect()

This method has four overloads. They can be used in Node.js programs and web pages to connect to the open services of applications.

  1. start(Object context, DOMString unique_name)
  2. start(Function callback, DOMString unique_name)
  3. start(Object context, DOMString Array unique_names)
  4. start(Function callback, DOMString Array unique_names)
Parameter Description
context The context is an object implementing start and fail methods.
callback User defined callback function that is called after the operation is finished.
unique_name Unique name of an application.
unique_names An array of unique names of applications.

Notice

Although this method can be used from the Node.js applications, it is not a good practice to connect to the open services of other applications with the connect method. List the required services in the manifest of the application and let the automation provided by the start method make the connections.

The overloads

1 and 2

These two overloads are used to connect to a single application. The connection is made to the open services of the application. The first overload calls the start method of the passed context on success and the fail method on failure. The callback function in the second overload is called with two arguments: callback(err, data).

Argument Type Desription
err JSON Object An error_object or null if no error occured.
data Boolean The return value is false on failure and true on success.

3 and 4

These overloads are identical to the overloads one and two with one exception. The connections are made to the open services of all the application listed in the array.

Close
copyright © Spaceify.org 2014