Class: Fdc3

Fdc3

The FDC3 Client Library provides a set APIs to be used for FDC3 compliance, while using our Interop API under the hood. In order to use this set of APIs you will need to set up your own InteropBroker or use a Platform application, which does the setup for you. Refer to our documentation on our Interop API.

We currently support APIs based on FDC3 1.2. To enable the FDC3 APIs in a Window or View, add the fdc3InteropApi property to its options:

{
    autoShow: false,
    saveWindowState: true,
    url: 'https://openfin.co',
    fdc3InteropApi: '1.2'
}

If using a Platform application, you can set this property in defaultWindowOptions and defaultViewOptions.

In order to ensure that the FDC3 Api is ready before use, you can use the 'fdc3Ready' event fired on the DOM Window object:

function fdc3Action() {
    // Make some fdc3 API calls here
}

if (window.fdc3) {
   fdc3Action();
} else {
   window.addEventListener('fdc3Ready', fdc3Action);
}

Methods

(async) findIntent(intent, contextopt) → {Promise.<AppIntent>}

Find out more information about a particular intent by passing its name, and optionally its context.

Parameters:
Name Type Attributes Description
intent string

Name of the Intent

context Context <optional>
Tutorials:
Returns:
Type
Promise.<AppIntent>

(async) findIntentsByContext(context) → {Promise.<Array.<AppIntent>>}

Find all the available intents for a particular context.

Parameters:
Name Type Description
context Context
Tutorials:
Returns:
Type
Promise.<Array.<AppIntent>>

(async) getCurrentChannel() → {Channel|null}

Returns the Channel that the entity is subscribed to. Returns null if not joined to a channel.

Tutorials:
Returns:
Type
Channel | null

getInfo() → {Promise.<ImplementationMetadata>}

Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.

Tutorials:
Returns:
Type
Promise.<ImplementationMetadata>

(async) getOrCreateChannel(channelId) → {Promise.<Channel>}

Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.

Parameters:
Name Type Description
channelId
Tutorials:
Returns:
Type
Promise.<Channel>

(async) open(app, contextopt) → {Promise.<void>}

Launches an app with target information, which can either be a string or an AppMetadata object.

Parameters:
Name Type Attributes Description
app TargetApp
context Context <optional>
Tutorials:
Returns:
Type
Promise.<void>

(async) raiseIntentForContext(context, appopt) → {Promise.<IntentResolution>}

Finds and raises an intent against a target app based purely on context data.

Parameters:
Name Type Attributes Description
context Context
app TargetApp <optional>
Tutorials:
Returns:
Type
Promise.<IntentResolution>

(static) addContextListener(contextType, handler) → {Listener}

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. If you wish to listen for all incoming contexts, pass null for the contextType argument.

Parameters:
Name Type Description
contextType string | null

The type of context you wish to handle.

handler ContextHandler

Handler for incoming context.

Tutorials:
Returns:
Type
Listener

(static) addIntentListener(intent, handler) → {Listener}

Adds a listener for incoming Intents.

Parameters:
Name Type Description
intent string

Name of the Intent

handler IntentHandler

Handler for incoming Intent

Tutorials:
Returns:
Type
Listener

(async, static) broadcast(context) → {Promise.<void>}

Broadcasts a context for the channel of the current entity.

Parameters:
Name Type Description
context Context

New context to set.

Tutorials:
Returns:
Type
Promise.<void>

(async, static) getSystemChannels() → {Promise.<Array.<Channel>>}

Returns the Interop-Broker-defined context groups available for an entity to join.

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

(async, static) joinChannel(channelId) → {Promise.<void>}

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 implementations, so this point is more-or-less moot.

Parameters:
Name Type Description
channelId string

Id of the context group.

Tutorials:
Returns:
Type
Promise.<void>

(async, static) leaveCurrentChannel() → {Promise.<void>}

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

Tutorials:
Returns:
Type
Promise.<void>

(async, static) raiseIntent(intent, context, app) → {IntentResolution}

Raises a specific intent.

Parameters:
Name Type Description
intent string

Name of the Intent.

context Context

Context associated with the Intent.

app TargetApp

App that will resolve the Intent. This is added as metadata to the Intent. Can be accessed by the app provider in InteropBroker.handleFiredIntent.

Tutorials:
Returns:
Type
IntentResolution