Class: InteropClient

InteropClient

THE INTEROP API IS EXPERIMENTAL. IF YOU WOULD LIKE TO USE IT, PLEASE USE OUR DEFAULT IMPLEMENTATION IN BROWSER

The Interop Client API is broken up into two groups:

Content Facing APIs - For Application Developers putting Views into a Platform Window, who care about Context. These are APIs that send out and receive the Context data that flows between applications. Think of this as the Water in the Interop Pipes.

Context Grouping APIs - For Platform Developers, to add and remove Views to and from Context Groups. These APIs are utilized under-the-hood in Platforms, so they don't need to be used to participate in Interop. These are the APIs that decide which entities the context data flows between. Think of these as the valves or pipes that control the flow of Context Data for Interop.


All APIs are available at the fin.me.interop namespace, after declaring context in the manifest or as view options.

 const viewOptions =
     {
         url: 'http://www.example.com',
         printName: 'Context Grouping',
         interop: {
             contextDeclaration: [
                 "instrument",
                 "country"
             ]
         }
      };
 fin.Platform.getCurrentSync().createView(viewOptions, fin.me.identity);

You only need 3 things to participate in Interop Context Grouping:


Constructor

Returned by Interop.connectSync.

Content Facing APIs
Context Grouping APIs - For Platform Window Use

Methods

(async) addContextHandler(handler, contextTypeopt) → {Promise.<Unsubscribe>}

EXPERIMENTAL

Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts.

Parameters:
Name Type Attributes Description
handler ContextHandler

Handler for incoming context.

contextType string <optional>

The type of context you wish to handle.

Tutorials:
Returns:
Type
Promise.<Unsubscribe>

(async) getAllClientsInContextGroup(contextGroupId) → {Promise.<Array.<ClientIdentity>>}

EXPERIMENTAL

Gets all clients for a context group. Used by Platform Windows.

Parameters:
Name Type Description
contextGroupId string

The id of context group you wish to get clients for.

Tutorials:
Returns:
Type
Promise.<Array.<ClientIdentity>>

(async) getContextGroups() → {Promise.<Array.<ContextGroupInfo>>}

EXPERIMENTAL

Returns the Interop-Broker-defined context groups available for an entity to join. Used by Platform Windows.

Tutorials:
Returns:
Type
Promise.<Array.<ContextGroupInfo>>

(async) getInfoForContextGroup(contextGroupId) → {Promise.<ContextGroupInfo>}

EXPERIMENTAL

Gets display info for a context group Used by Platform Windows.

Parameters:
Name Type Description
contextGroupId string

The id of context group you wish to get display info for.

Tutorials:
Returns:
Type
Promise.<ContextGroupInfo>

(async) joinContextGroup(contextGroupId, targetopt) → {Promise.<void>}

EXPERIMENTAL

Join all Interop Clients at the given identity to context group contextGroupId. If no target is specified, it adds the sender to the context group. Because multiple Channel connections/Interop Clients can potentially exist at a uuid/name combo, we currently join all Channel connections/Interop Clients at the given identity to the context group. If an endpointId is provided (which is unlikely, unless the call is coming from an external adapter), then we only join that single connection to the context group. For all intents and purposes, there will only be 1 connection present in Platform and Browser implmentations, so this point is more-or-less moot. Used by Platform Windows.

Parameters:
Name Type Attributes Description
contextGroupId string

Id of the context group.

target Identity <optional>

Identity of the entity you wish to join to a context group.

Tutorials:
Returns:
Type
Promise.<void>

(async) removeFromContextGroup(targetopt) → {Promise.<void>}

EXPERIMENTAL

Removes the specified target from a context group. If no target is specified, it removes the sender from their context group. Used by Platform Windows.

Parameters:
Name Type Attributes Description
target Identity <optional>

Identity of the entity you wish to join to a context group.

Tutorials:
Returns:
Type
Promise.<void>

(async) setContext(context) → {Promise.<void>}

EXPERIMENTAL

Sets a context for the context group of the current entity.

Parameters:
Name Type Description
context Context

New context to set.

Tutorials:
Returns:
Type
Promise.<void>