Adds a listener for incoming context broadcast from the Desktop Agent.
use addContextListener(null, handler)
instead of addContextListener(handler)
.
Adds a listener for the broadcast of a specific type of context object.
Find out more information about a particular intent by passing its name, and optionally its context.
findIntent is effectively granting programmatic access to the Desktop Agent's resolver. A promise resolving to the intent, its metadata and metadata about the apps that registered it is returned. This can be used to raise the intent against a specific app.
If the resolution fails, the promise will return an Error
with a string from the ResolveError
enumeration.
// I know 'StartChat' exists as a concept, and want to know more about it ...
const appIntent = await agent.findIntent("StartChat");
// returns a single AppIntent:
// {
// intent: { name: "StartChat", displayName: "Chat" },
// apps: [{ name: "Skype" }, { name: "Symphony" }, { name: "Slack" }]
// }
// raise the intent against a particular app
await agent.raiseIntent(appIntent.intent.name, context, appIntent.apps[0].name);
Find all the avalable intents for a particular context.
findIntents is effectively granting programmatic access to the Desktop Agent's resolver. A promise resolving to all the intents, their metadata and metadata about the apps that registered it is returned, based on the context types the intents have registered.
If the resolution fails, the promise will return an Error
with a string from the ResolveError
enumeration.
// I have a context object, and I want to know what I can do with it, hence, I look for for intents...
const appIntents = await agent.findIntentsByContext(context);
// returns for example:
// [{
// intent: { name: "StartCall", displayName: "Call" },
// apps: [{ name: "Skype" }]
// },
// {
// intent: { name: "StartChat", displayName: "Chat" },
// apps: [{ name: "Skype" }, { name: "Symphony" }, { name: "Slack" }]
// }];
// select a particular intent to raise
const startChat = appIntents[1];
// target a particular app
const selectedApp = startChat.apps[0];
// raise the intent, passing the given context, targeting the app
await agent.raiseIntent(startChat.intent.name, context, selectedApp.name);
Retrieves information about the FDC3 Desktop Agent implementation, such as the implemented version of the FDC3 specification and the name of the implementation provider.
Returns a channel with the given identity. Either stands up a new channel or returns an existing channel.
It is up to applications to manage how to share knowledge of these custom channels across windows and to manage channel ownership and lifecycle.
Error
with a string from the ChannelError
enumeration.
Joins the app to the specified channel.
An app can only be joined to one channel at a time.
Rejects with error if the channel is unavailable or the join request is denied.
Error
with a string from the ChannelError
enumeration.
Launches an app by target, which can be optionally a string like a name, or an AppMetadata object.
If a Context object is passed in, this object will be provided to the opened application via a contextListener. The Context argument is functionally equivalent to opening the target app with no context and broadcasting the context directly to it.
If opening errors, it returns an Error
with a string from the OpenError
enumeration.
//no context and string as target
agent.open('myApp');
//no context and AppMetadata object as target
agent.open({name: 'myApp', title: 'The title for the application myApp.', description: '...'});
//with context
agent.open('myApp', context);
Raises an intent to the desktop agent to resolve.
//Find apps to resolve an intent to start a chat with a given contact
const appIntent = await fdc3.findIntent("StartChat", context);
//use the returned AppIntent object to target one of the returned chat apps with the context
await fdc3.raiseIntent("StartChat", context, appIntent.apps[0].name);
//or use one of the AppMetadata objects returned in the AppIntent object's 'apps' array
await fdc3.raiseIntent("StartChat", context, appMetadata);
Raises a context to the desktop agent to resolve with one of the possible Intents for that context.
await fdc3.raiseIntentForContext(context);
A Desktop Agent is a desktop component (or aggregate of components) that serves as a launcher and message router (broker) for applications in its domain.
A Desktop Agent can be connected to one or more App Directories and will use directories for application identity and discovery. Typically, a Desktop Agent will contain the proprietary logic of a given platform, handling functionality like explicit application interop workflows where security, consistency, and implementation requirements are proprietary.