Tutorial: interop.invokeContextHandler

interop.invokeContextHandler

This function is called by the Interop Broker whenever a Context handler would fire. For FDC3 2.0 you would need to override this function and add the contextMetadata as part of the Context object. Then would you need to call super.invokeContextHandler passing it this new Context object along with the clientIdentity and handlerId

Example

fin.Platform.init({
    interopOverride: async (InteropBroker) => {
        class Override extends InteropBroker {
            async invokeContextHandler(options, clientIdentity) {
                return super.invokeContextHandler(clientIdentity, handlerId, {
                    ...context,
                    contextMetadata: {
                        source: {
                            appId: 'openfin-app',
                            instanceId: '3D54D456D9HT0'
                        }
                    }
                });
            }
        }
        return new Override();
    }
});