Tutorial: interop.handleInfoForIntentsByContext

interop.handleInfoForIntentsByContext

Responsible for returning information on which Intents are meant to handle a specific Context. Must be overridden.

Whenever InteropClient.getInfoForIntentsByContext is called this function will fire. The context argument gives you access to the context that the client wants information on and clientIdentity is the identity of the client that made the call. Ideally here you would fetch the info for any intent that can handle and return it with the shape that the InteropClient.getInfoForIntentsByContext call is expecting.

To make this call FDC3-Compliant it would need to return an array of AppIntents:

// [{
//     intent: { name: "StartCall", displayName: "Call" },
//     apps: [{ name: "Skype" }]
// },
// {
//     intent: { name: "StartChat", displayName: "Chat" },
//     apps: [{ name: "Skype" }, { name: "Symphony" }, { name: "Slack" }]
// }];

More information on the AppIntent type can be found in the FDC3 documentation.

Example

fin.Platform.init({
    interopOverride: async (InteropBroker) => {
        class Override extends InteropBroker {
            async handleInfoForIntentsByContext(context, clientIdentity) {
                // Your code goes here.
            }
        }
        return new Override();
    }
});