Tutorial: interop.getAllClientInfo

interop.getAllClientInfo

Returns an array with info on every Client connected to the Provider.

FDC3 2.0 Note: When needing an instanceId to generate an AppIdentifier use this call to get the endpointId and use it as the instanceId. In the Example below we override handleFiredIntent and then call super.getAllClientInfo to generate the AppIdentifier for the IntentResolution

Example

// FDC3 2.0 Example: 
fin.Platform.init({
    interopOverride: async (InteropBroker, ...args) => {
        class Override extends InteropBroker {
            async handleFiredIntent(intent) {
                super.setIntentTarget(intent, { uuid: 'platform-uuid', name: 'intent-view' });
                const platform = fin.Platform.getCurrentSync();
                const win = fin.Window.wrapSync({ name: 'foo', uuid: 'platform-uuid' });
                const createdView = await platform.createView({ url: 'http://openfin.co', name: 'intent-view' }, win.identity);

                const allClientInfo = await super.getAllClientInfo();

                const infoForTarget = allClientInfo.find((clientInfo) => {
                    return clientInfo.uuid === 'platform-uuid' && clientInfo.name === 'intent-view';
                });

                const source = {
                    appId: 'intent-view',
                    instanceId: infoForTarget.endpointId
                }

                return {
                    source,
                    intent: intent.name
                }

            }
        }
        return new Override(...args);
    }
});